From 9dbdada803ac8caf6ba16537130bce53ee91b4e3 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Wed, 19 Oct 2022 19:24:01 +0800 Subject: [PATCH] fix quant analysis algo (#1472) --- paddleslim/quant/analysis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddleslim/quant/analysis.py b/paddleslim/quant/analysis.py index 4fd83db7..9ed1e480 100644 --- a/paddleslim/quant/analysis.py +++ b/paddleslim/quant/analysis.py @@ -87,6 +87,8 @@ class AnalysisQuant(object): 'is_full_quantize'] if 'is_full_quantize' in ptq_config else False self.onnx_format = ptq_config[ 'onnx_format'] if 'onnx_format' in ptq_config else False + if 'algo' not in ptq_config: + ptq_config['algo'] = 'avg' if not os.path.exists(self.save_dir): os.mkdir(self.save_dir) @@ -126,7 +128,6 @@ class AnalysisQuant(object): model_filename=self.model_filename, params_filename=self.params_filename, skip_tensor_list=None, - algo='avg', #fastest onnx_format=self.onnx_format, **self.ptq_config) program = post_training_quantization.quantize() @@ -283,7 +284,6 @@ class AnalysisQuant(object): params_filename=self.params_filename, skip_tensor_list=skip_list, onnx_format=self.onnx_format, - algo='avg', #fastest **self.ptq_config) program = post_training_quantization.quantize() _logger.info('Evaluating...') -- GitLab