From 607a7297051695afd08aa92edf4cb56b01c9f067 Mon Sep 17 00:00:00 2001 From: xiaoyisd Date: Fri, 4 Dec 2020 10:11:53 +0800 Subject: [PATCH] fix eval symmetric bug --- model_zoo/official/cv/mobilenetv2_quant/eval.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/model_zoo/official/cv/mobilenetv2_quant/eval.py b/model_zoo/official/cv/mobilenetv2_quant/eval.py index 76850fabeca..b49c6848e41 100644 --- a/model_zoo/official/cv/mobilenetv2_quant/eval.py +++ b/model_zoo/official/cv/mobilenetv2_quant/eval.py @@ -41,10 +41,12 @@ if __name__ == '__main__': config_device_target = config_ascend_quant context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", device_id=device_id, save_graphs=False) + symmetric_list = [True, False] elif args_opt.device_target == "GPU": config_device_target = config_gpu_quant context.set_context(mode=context.GRAPH_MODE, device_target="GPU", device_id=device_id, save_graphs=False) + symmetric_list = [False, False] else: raise ValueError("Unsupported device target: {}.".format(args_opt.device_target)) @@ -53,7 +55,7 @@ if __name__ == '__main__': # convert fusion network to quantization aware network quantizer = QuantizationAwareTraining(bn_fold=True, per_channel=[True, False], - symmetric=[True, False]) + symmetric=symmetric_list) network = quantizer.quantize(network) # define network loss loss = nn.SoftmaxCrossEntropyWithLogits(sparse=True, reduction='mean')