timm documentation

DPN

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.0.30).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

DPN

Category: CNN · Code: timm/models/dpn.py · Architectures: 7 · Pretrained weights: 7 (7 with ImageNet-1k results)

Dual Path Networks combine a residual path (feature re-use) and a densely connected path (new feature exploration) in each block. Compatible with the weights of the original MXNet implementation.

Papers

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('dpn92.mx_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

FeatureDPN
features_only=True feature maps✓ (strides 2, 4, 8, 16, 32)
forward_intermediates()✗
prune_intermediate_layers()✗
Any input size, no changes needed✓
set_input_size()–
dynamic_img_size=True–
set_grad_checkpointing()✗
Layer-wise LR decay (group_matcher())✓
reset_classifier()✓

✓ supported, ✓ (square) works for square sizes only, ✗ not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (DPN with dpn48b at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

ArchitectureParams (M)GMACsInput sizePretrained weights
dpn48b9.131.692240
dpn6812.612.352241
dpn68b12.612.352242
dpn9237.676.542241
dpn9861.5711.732241
dpn10786.9218.382241
dpn13179.2516.092241

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
dpn68.mx_in1k22476.3042241000apache-2.0timm
dpn68b.mx_in1k22477.4942241000apache-2.0timm
dpn68b.ra_in1k224 (test 288)79.3422881000apache-2.0timm
dpn92.mx_in1k22480.0322241000apache-2.0timm
dpn98.mx_in1k22479.6642241000apache-2.0timm
dpn107.mx_in1k22480.1662241000apache-2.0timm
dpn131.mx_in1k22479.8362241000apache-2.0timm
Update on GitHub