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
wangsen
paddle_dbnet
Commits
c5d2d7ed
Unverified
Commit
c5d2d7ed
authored
May 05, 2022
by
andyjpaddle
Committed by
GitHub
May 05, 2022
Browse files
Merge pull request #6133 from andyjpaddle/dygraph
fix pact train for freezed param
parents
0f8408fd
f2375eed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
deploy/slim/quantization/quant.py
deploy/slim/quantization/quant.py
+7
-1
No files found.
deploy/slim/quantization/quant.py
View file @
c5d2d7ed
...
@@ -161,7 +161,13 @@ def main(config, device, logger, vdl_writer):
...
@@ -161,7 +161,13 @@ def main(config, device, logger, vdl_writer):
if
config
[
"Global"
][
"pretrained_model"
]
is
not
None
:
if
config
[
"Global"
][
"pretrained_model"
]
is
not
None
:
pre_best_model_dict
=
load_model
(
config
,
model
)
pre_best_model_dict
=
load_model
(
config
,
model
)
quanter
=
QAT
(
config
=
quant_config
,
act_preprocess
=
PACT
)
freeze_params
=
False
if
config
[
'Architecture'
][
"algorithm"
]
in
[
"Distillation"
]:
for
key
in
config
[
'Architecture'
][
"Models"
]:
freeze_params
=
freeze_params
or
config
[
'Architecture'
][
'Models'
][
key
].
get
(
'freeze_params'
,
False
)
act
=
None
if
freeze_params
else
PACT
quanter
=
QAT
(
config
=
quant_config
,
act_preprocess
=
act
)
quanter
.
quantize
(
model
)
quanter
.
quantize
(
model
)
if
config
[
'Global'
][
'distributed'
]:
if
config
[
'Global'
][
'distributed'
]:
...
...
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