From 5c7b6dc74b2c5378c0b491ed16a07f620bc221f7 Mon Sep 17 00:00:00 2001 From: andyjpaddle Date: Thu, 5 May 2022 02:57:58 +0000 Subject: [PATCH] fix det pact --- deploy/slim/quantization/quant.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy/slim/quantization/quant.py b/deploy/slim/quantization/quant.py index f7acb185..a44a8b58 100755 --- a/deploy/slim/quantization/quant.py +++ b/deploy/slim/quantization/quant.py @@ -161,7 +161,13 @@ def main(config, device, logger, vdl_writer): if config["Global"]["pretrained_model"] is not None: 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) if config['Global']['distributed']: -- GitLab