PaddleSlim icon indicating copy to clipboard operation
PaddleSlim copied to clipboard

mobilenet-v2结构per-channel定点在matmul_v2层报错

Open GtxMiracle opened this issue 2 years ago • 1 comments

我使用pytorch导出的mbv2 onnx模型转为静态paddle图再进行后训练量化。量化模型可以正确生成,但运行报错:RuntimeError: (PreconditionNotMet) The number of first scale values must be the same with corresponding dimension value of Input(X) when the Scales has two elements, but 1280 != 1000 here. [Hint: Expected scales[0]->numel() == in->dims()[x_num_col_dims], but received scales[0]->numel():1280 != in->dims()[x_num_col_dims]:1000.]

若设置quant_post_static函数中的is_full_quantize为False并设置quantizable_op_type为["conv2d", "depthwise_conv2d", "mul","elementwise_add","pool2d"],则不会出现该错误。请问是matmul_v2这个算子不支持per-channel定点吗?

GtxMiracle avatar Jul 06 '23 13:07 GtxMiracle

请问下使用的是什么版本的paddle?最新的应该是支持的

ceci3 avatar Feb 06 '24 07:02 ceci3