Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
12be107b
Unverified
Commit
12be107b
authored
Mar 12, 2020
by
hx89
Committed by
GitHub
Mar 12, 2020
Browse files
Update inception quantized model path (#1969)
* update model path * remove autologits before loading quantized model
parent
bbb4a9a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
torchvision/models/quantization/inception.py
torchvision/models/quantization/inception.py
+8
-4
No files found.
torchvision/models/quantization/inception.py
View file @
12be107b
...
@@ -20,7 +20,7 @@ __all__ = [
...
@@ -20,7 +20,7 @@ __all__ = [
quant_model_urls
=
{
quant_model_urls
=
{
# fp32 weights ported from TensorFlow, quantized in PyTorch
# fp32 weights ported from TensorFlow, quantized in PyTorch
"inception_v3_google_fbgemm"
:
"inception_v3_google_fbgemm"
:
"https://download.pytorch.org/models/quantized/inception_v3_google_fbgemm-
4f6e489
4.pth"
"https://download.pytorch.org/models/quantized/inception_v3_google_fbgemm-
71447a4
4.pth"
}
}
...
@@ -65,6 +65,9 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs):
...
@@ -65,6 +65,9 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs):
if
pretrained
:
if
pretrained
:
if
quantize
:
if
quantize
:
if
not
original_aux_logits
:
model
.
aux_logits
=
False
del
model
.
AuxLogits
model_url
=
quant_model_urls
[
'inception_v3_google'
+
'_'
+
backend
]
model_url
=
quant_model_urls
[
'inception_v3_google'
+
'_'
+
backend
]
else
:
else
:
model_url
=
inception_module
.
model_urls
[
'inception_v3_google'
]
model_url
=
inception_module
.
model_urls
[
'inception_v3_google'
]
...
@@ -74,9 +77,10 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs):
...
@@ -74,9 +77,10 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs):
model
.
load_state_dict
(
state_dict
)
model
.
load_state_dict
(
state_dict
)
if
not
original_aux_logits
:
if
not
quantize
:
model
.
aux_logits
=
False
if
not
original_aux_logits
:
del
model
.
AuxLogits
model
.
aux_logits
=
False
del
model
.
AuxLogits
return
model
return
model
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment