Skip to content

Commit 12be107

Browse files
authored
Update inception quantized model path (#1969)
* update model path * remove autologits before loading quantized model
1 parent bbb4a9a commit 12be107

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

torchvision/models/quantization/inception.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
quant_model_urls = {
2121
# fp32 weights ported from TensorFlow, quantized in PyTorch
2222
"inception_v3_google_fbgemm":
23-
"https://download.pytorch.org/models/quantized/inception_v3_google_fbgemm-4f6e4894.pth"
23+
"https://download.pytorch.org/models/quantized/inception_v3_google_fbgemm-71447a44.pth"
2424
}
2525

2626

@@ -65,6 +65,9 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs):
6565

6666
if pretrained:
6767
if quantize:
68+
if not original_aux_logits:
69+
model.aux_logits = False
70+
del model.AuxLogits
6871
model_url = quant_model_urls['inception_v3_google' + '_' + backend]
6972
else:
7073
model_url = inception_module.model_urls['inception_v3_google']
@@ -74,9 +77,10 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs):
7477

7578
model.load_state_dict(state_dict)
7679

77-
if not original_aux_logits:
78-
model.aux_logits = False
79-
del model.AuxLogits
80+
if not quantize:
81+
if not original_aux_logits:
82+
model.aux_logits = False
83+
del model.AuxLogits
8084
return model
8185

8286

0 commit comments

Comments
 (0)