Skip to content

Commit f004a1a

Browse files
authored
Merge branch 'main' into prabhat00155/update_wide_resnet101_weights
2 parents 25dcc01 + 34c8b54 commit f004a1a

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
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(

0 commit comments

Comments
 (0)