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
d07da41d
Unverified
Commit
d07da41d
authored
Apr 27, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Apr 27, 2022
Browse files
Document MobileNetV3 quantization approach (#5891)
* Document MobileNetV3 quantization approach * Change the URL.
parent
79703b26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
torchvision/models/quantization/mobilenetv3.py
torchvision/models/quantization/mobilenetv3.py
+4
-0
No files found.
torchvision/models/quantization/mobilenetv3.py
View file @
d07da41d
...
...
@@ -140,6 +140,10 @@ def _mobilenet_v3_model(
_replace_relu
(
model
)
if
quantize
:
# Instead of quantizing the model and then loading the quantized weights we take a different approach.
# We prepare the QAT model, load the QAT weights from training and then convert it.
# This is done to avoid extremely low accuracies observed on the specific model. This is rather a workaround
# for an unresolved bug on the eager quantization API detailed at: https://github.com/pytorch/vision/issues/5890
model
.
fuse_model
(
is_qat
=
True
)
model
.
qconfig
=
torch
.
ao
.
quantization
.
get_default_qat_qconfig
(
backend
)
torch
.
ao
.
quantization
.
prepare_qat
(
model
,
inplace
=
True
)
...
...
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