Skip to content

Commit 6688d06

Browse files
committed
PyTorch trained MobileNetV3 weights that match/best paper. Update fbnetc weights to improved copy.
1 parent 89e77ec commit 6688d06

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ Several (less common) features that I often utilize in my projects are included.
6262
### Self-trained Weights
6363
I've leveraged the training scripts in this repository to train a few of the models with missing weights to good levels of performance. These numbers are all for 224x224 training and validation image sizing with the usual 87.5% validation crop.
6464

65+
#### @ 224x224
6566
|Model | Prec@1 (Err) | Prec@5 (Err) | Param # | Image Scaling |
6667
|---|---|---|---|---|
6768
| resnext50_32x4d | 78.512 (21.488) | 94.042 (5.958) | 25M | bicubic |
6869
| seresnext26_32x4d | 77.104 (22.896) | 93.316 (6.684) | 16.8M | bicubic |
70+
| mobilenetv3_100 | 75.634 (24.366) | 92.708 (7.292) | 5.5M | bicubic |
71+
| fbnetc_100 | 75.124 (24.876) | 92.386 (7.614) | 5.6M | bilinear |
6972
| resnet34 | 75.110 (24.890) | 92.284 (7.716) | 22M | bilinear |
70-
| fbnetc_100 | 74.830 (25.170 | 92.124 (7.876) | 5.6M | bilinear |
7173
| seresnet34 | 74.808 (25.192) | 92.124 (7.876) | 22M | bilinear |
7274
| spnasnet_100 | 74.084 (25.916) | 91.818 (8.182) | 4.42M | bilinear |
7375
| seresnet18 | 71.742 (28.258) | 90.334 (9.666) | 11.8M | bicubic |

models/gen_efficientnet.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,15 @@ def _cfg(url='', **kwargs):
6565
'mobilenetv2_100': _cfg(url=''),
6666
'mobilenetv3_050': _cfg(url=''),
6767
'mobilenetv3_075': _cfg(url=''),
68-
'mobilenetv3_100': _cfg(url=''),
68+
'mobilenetv3_100': _cfg(
69+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/mobilenetv3_100-35495452.pth',
70+
interpolation='bicubic'),
6971
'chamnetv1_100': _cfg(url=''),
7072
'chamnetv2_100': _cfg(url=''),
71-
'fbnetc_100': _cfg(url='https://www.dropbox.com/s/0ku2tztuibrynld/fbnetc_100-f49a0c5f.pth?dl=1'),
72-
'spnasnet_100': _cfg(url='https://www.dropbox.com/s/iieopt18rytkgaa/spnasnet_100-048bc3f4.pth?dl=1'),
73+
'fbnetc_100': _cfg(
74+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/fbnetc_100-c345b898.pth'),
75+
'spnasnet_100': _cfg(
76+
url='https://www.dropbox.com/s/iieopt18rytkgaa/spnasnet_100-048bc3f4.pth?dl=1'),
7377
'efficientnet_b0': _cfg(url=''),
7478
'efficientnet_b1': _cfg(url='', input_size=(3, 240, 240)),
7579
'efficientnet_b2': _cfg(url='', input_size=(3, 260, 260)),
@@ -1335,6 +1339,9 @@ def mobilenetv3_075(num_classes, in_chans=3, pretrained=False, **kwargs):
13351339
def mobilenetv3_100(num_classes, in_chans=3, pretrained=False, **kwargs):
13361340
""" MobileNet V3 """
13371341
default_cfg = default_cfgs['mobilenetv3_100']
1342+
if pretrained:
1343+
# pretrained model trained with non-default BN epsilon
1344+
kwargs['bn_eps'] = _BN_EPS_TF_DEFAULT
13381345
model = _gen_mobilenet_v3(1.0, num_classes=num_classes, in_chans=in_chans, **kwargs)
13391346
model.default_cfg = default_cfg
13401347
if pretrained:

0 commit comments

Comments
 (0)