Skip to content

Commit 9841a90

Browse files
authored
Better model checkpoints for various classification models (#4900)
* Add new weights for MobileNetV3 Large. * Update weights for ResNet101. * Update weights for ResNet152. * Update numbers of ResNet101 and ResNet152 with batch size 1. * Adding new weights for ResNeXt101_32x8d * Batch size 1 stats for ResNeXt101_32x8d * Update weights for MobileNetV3 Large. * Update weights for ResNeXt50. * Fix merge issues. * Updating the URLs to indicate the recipe config.
1 parent 983d27e commit 9841a90

File tree

2 files changed

+37
-16
lines changed

2 files changed

+37
-16
lines changed

torchvision/prototype/models/mobilenetv3.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def _mobilenet_v3(
4141
"size": (224, 224),
4242
"categories": _IMAGENET_CATEGORIES,
4343
"interpolation": InterpolationMode.BILINEAR,
44-
"recipe": "https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv3-large--small",
4544
}
4645

4746

@@ -51,10 +50,21 @@ class MobileNetV3LargeWeights(Weights):
5150
transforms=partial(ImageNetEval, crop_size=224),
5251
meta={
5352
**_COMMON_META,
53+
"recipe": "https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv3-large--small",
5454
"acc@1": 74.042,
5555
"acc@5": 91.340,
5656
},
5757
)
58+
ImageNet1K_RefV2 = WeightEntry(
59+
url="https://download.pytorch.org/models/mobilenet_v3_large-5c1a4163.pth",
60+
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
61+
meta={
62+
**_COMMON_META,
63+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe-with-reg-tuning",
64+
"acc@1": 75.274,
65+
"acc@5": 92.566,
66+
},
67+
)
5868

5969

6070
class MobileNetV3SmallWeights(Weights):
@@ -63,6 +73,7 @@ class MobileNetV3SmallWeights(Weights):
6373
transforms=partial(ImageNetEval, crop_size=224),
6474
meta={
6575
**_COMMON_META,
76+
"recipe": "https://github.com/pytorch/vision/tree/main/references/classification#mobilenetv3-large--small",
6677
"acc@1": 67.668,
6778
"acc@5": 87.402,
6879
},

torchvision/prototype/models/resnet.py

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ResNet50Weights(Weights):
9696
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
9797
meta={
9898
**_COMMON_META,
99-
"recipe": "https://github.com/pytorch/vision/issues/3995",
99+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres",
100100
"acc@1": 80.674,
101101
"acc@5": 95.166,
102102
},
@@ -115,13 +115,13 @@ class ResNet101Weights(Weights):
115115
},
116116
)
117117
ImageNet1K_RefV2 = WeightEntry(
118-
url="https://download.pytorch.org/models/resnet101-b641f3a9.pth",
118+
url="https://download.pytorch.org/models/resnet101-cd907fc2.pth",
119119
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
120120
meta={
121121
**_COMMON_META,
122-
"recipe": "https://github.com/pytorch/vision/issues/3995",
123-
"acc@1": 81.728,
124-
"acc@5": 95.670,
122+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe",
123+
"acc@1": 81.886,
124+
"acc@5": 95.780,
125125
},
126126
)
127127

@@ -138,13 +138,13 @@ class ResNet152Weights(Weights):
138138
},
139139
)
140140
ImageNet1K_RefV2 = WeightEntry(
141-
url="https://download.pytorch.org/models/resnet152-089c0848.pth",
141+
url="https://download.pytorch.org/models/resnet152-f82ba261.pth",
142142
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
143143
meta={
144144
**_COMMON_META,
145-
"recipe": "https://github.com/pytorch/vision/issues/3995",
146-
"acc@1": 82.042,
147-
"acc@5": 95.926,
145+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe",
146+
"acc@1": 82.284,
147+
"acc@5": 96.002,
148148
},
149149
)
150150

@@ -161,13 +161,13 @@ class ResNeXt50_32x4dWeights(Weights):
161161
},
162162
)
163163
ImageNet1K_RefV2 = WeightEntry(
164-
url="https://download.pytorch.org/models/resnext50_32x4d-b260af35.pth",
164+
url="https://download.pytorch.org/models/resnext50_32x4d-1a0047aa.pth",
165165
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
166166
meta={
167167
**_COMMON_META,
168-
"recipe": "https://github.com/pytorch/vision/issues/3995",
169-
"acc@1": 81.116,
170-
"acc@5": 95.478,
168+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe",
169+
"acc@1": 81.198,
170+
"acc@5": 95.340,
171171
},
172172
)
173173

@@ -183,6 +183,16 @@ class ResNeXt101_32x8dWeights(Weights):
183183
"acc@5": 94.526,
184184
},
185185
)
186+
ImageNet1K_RefV2 = WeightEntry(
187+
url="https://download.pytorch.org/models/resnext101_32x8d-110c445d.pth",
188+
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
189+
meta={
190+
**_COMMON_META,
191+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres",
192+
"acc@1": 82.834,
193+
"acc@5": 96.228,
194+
},
195+
)
186196

187197

188198
class WideResNet50_2Weights(Weights):
@@ -201,7 +211,7 @@ class WideResNet50_2Weights(Weights):
201211
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
202212
meta={
203213
**_COMMON_META,
204-
"recipe": "https://github.com/pytorch/vision/issues/3995",
214+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres",
205215
"acc@1": 81.602,
206216
"acc@5": 95.758,
207217
},
@@ -224,7 +234,7 @@ class WideResNet101_2Weights(Weights):
224234
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
225235
meta={
226236
**_COMMON_META,
227-
"recipe": "https://github.com/pytorch/vision/issues/3995",
237+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres",
228238
"acc@1": 82.492,
229239
"acc@5": 96.110,
230240
},

0 commit comments

Comments
 (0)