opensi·si

timm/models/rexnet.py ·

ReXNet

Category: Efficient/Mobile · Code: timm/models/rexnet.py · Architectures: 10 · Pretrained weights: 9 (7 with ImageNet-1k results)

ReXNet revises the channel configuration of inverted residual networks to reduce representational bottlenecks. The rexnetr_* variants round the channels to multiples of 8.

Papers

  • Rethinking Channel Dimensions for Efficient Model Design

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('rexnet_300.nav_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

Feature RexNet
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 (RexNet with rexnet_100 at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

Architecture Params (M) GMACs Input size Pretrained weights
rexnet_100 4.80 0.41 224 1
rexnet_130 7.56 0.68 224 1
rexnet_150 9.73 0.90 224 1
rexnet_200 16.37 1.56 224 1
rexnet_300 34.71 3.44 224 1
rexnetr_100 4.88 0.43 224 0
rexnetr_130 7.61 0.68 224 0
rexnetr_150 9.78 0.89 224 0
rexnetr_200 16.52 1.59 224 2
rexnetr_300 34.81 3.39 224 2

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.

Weights are grouped by source: the paper or origin given in the pretrained config, else a Hub organization other than timm, else the first part of the pretrained tag (architecture.tag). Sources with a single weight are listed under other.

Weight Input size Top-1 (%) Eval size Classes License Hub
rexnet_100.nav_in1k 224 77.862 224 1000 mit timm
rexnet_130.nav_in1k 224 79.492 224 1000 mit timm
rexnet_150.nav_in1k 224 80.322 224 1000 mit timm
rexnet_200.nav_in1k 224 81.636 224 1000 mit timm
rexnet_300.nav_in1k 224 82.780 224 1000 mit timm

sw tags

Weight Input size Top-1 (%) Eval size Classes License Hub
rexnetr_200.sw_in12k 224 (test 288) - - 11821 apache-2.0 timm
rexnetr_200.sw_in12k_ft_in1k 224 (test 288) 83.160 288 1000 apache-2.0 timm
rexnetr_300.sw_in12k 224 (test 288) - - 11821 apache-2.0 timm
rexnetr_300.sw_in12k_ft_in1k 224 (test 288) 84.582 288 1000 apache-2.0 timm

Source and license

Source: timm documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.