未验证 提交 9dbdada8 编写于 作者: G Guanghua Yu 提交者: GitHub

fix quant analysis algo (#1472)

上级 0bfd05d4
......@@ -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...')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册