未验证 提交 c5d2d7ed 编写于 作者: A andyjpaddle 提交者: GitHub

Merge pull request #6133 from andyjpaddle/dygraph

fix pact train for freezed  param
...@@ -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']:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册