Skip to content

Commit 4b1f7c2

Browse files
authored
Merge branch 'main' into prototype/multitype_get_weight
2 parents 015ee04 + ebc4ca7 commit 4b1f7c2

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

torchvision/models/quantization/mobilenetv3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _load_from_state_dict(
4343
):
4444
version = local_metadata.get("version", None)
4545

46-
if version is None or version < 2:
46+
if hasattr(self, "qconfig") and (version is None or version < 2):
4747
default_state_dict = {
4848
"scale_activation.activation_post_process.scale": torch.tensor([1.0]),
4949
"scale_activation.activation_post_process.zero_point": torch.tensor([0], dtype=torch.int32),

torchvision/prototype/models/quantization/resnet.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ class QuantizedResNet50Weights(Weights):
8787
"acc@5": 92.814,
8888
},
8989
)
90+
ImageNet1K_FBGEMM_RefV2 = WeightEntry(
91+
url="https://download.pytorch.org/models/quantized/resnet50_fbgemm-23753f79.pth",
92+
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
93+
meta={
94+
**_COMMON_META,
95+
"unquantized": ResNet50Weights.ImageNet1K_RefV2,
96+
"acc@1": 80.282,
97+
"acc@5": 94.976,
98+
},
99+
)
90100

91101

92102
class QuantizedResNeXt101_32x8dWeights(Weights):
@@ -100,6 +110,16 @@ class QuantizedResNeXt101_32x8dWeights(Weights):
100110
"acc@5": 94.480,
101111
},
102112
)
113+
ImageNet1K_FBGEMM_RefV2 = WeightEntry(
114+
url="https://download.pytorch.org/models/quantized/resnext101_32x8_fbgemm-ee16d00c.pth",
115+
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
116+
meta={
117+
**_COMMON_META,
118+
"unquantized": ResNeXt101_32x8dWeights.ImageNet1K_RefV2,
119+
"acc@1": 82.574,
120+
"acc@5": 96.132,
121+
},
122+
)
103123

104124

105125
def resnet18(

torchvision/prototype/models/resnet.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,13 @@ class WideResNet101_2Weights(Weights):
230230
},
231231
)
232232
ImageNet1K_RefV2 = WeightEntry(
233-
url="https://download.pytorch.org/models/wide_resnet101_2-b8680a8c.pth",
233+
url="https://download.pytorch.org/models/wide_resnet101_2-d733dc28.pth",
234234
transforms=partial(ImageNetEval, crop_size=224, resize_size=232),
235235
meta={
236236
**_COMMON_META,
237-
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe-with-fixres",
238-
"acc@1": 82.492,
239-
"acc@5": 96.110,
237+
"recipe": "https://github.com/pytorch/vision/issues/3995#new-recipe",
238+
"acc@1": 82.510,
239+
"acc@5": 96.020,
240240
},
241241
)
242242

0 commit comments

Comments
 (0)