Skip to content

Commit 2ea7133

Browse files
authored
Amend the weights only if quantize=True. (#4966) (#5066)
1 parent 73efcc6 commit 2ea7133

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-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.]),
4949
"scale_activation.activation_post_process.zero_point": torch.tensor([0], dtype=torch.int32),

0 commit comments

Comments
 (0)