FastDeploy icon indicating copy to clipboard operation
FastDeploy copied to clipboard

Due to the unsupported operators, the conversion is aborted.

Open weijingsu opened this issue 3 years ago • 11 comments

/home/aistudio/work/FastDeploy/examples/vision/detection/paddledetection/quantize/python [INFO] fastdeploy/vision/common/processors/transform.cc(45)::FuseNormalizeCast Normalize and Cast are fused to Normalize in preprocessing pipeline. [INFO] fastdeploy/vision/common/processors/transform.cc(93)::FuseNormalizeHWC2CHW Normalize and HWC2CHW are fused to NormalizeAndPermute in preprocessing pipeline. [INFO] fastdeploy/vision/common/processors/transform.cc(159)::FuseNormalizeColorConvert BGR2RGB and NormalizeAndPermute are fused to NormalizeAndPermute with swap_rb=1 [Paddle2ONNX] [Info] The Paddle model is a quantized model. [Paddle2ONNX] Oops, there are some operators not supported yet, including fake_channel_wise_dequantize_max_abs,fake_quantize_moving_average_abs_max,masked_select, [ERROR] Due to the unsupported operators, the conversion is aborted.

在CPU上使用ONNX Runtime推理量化模型 !python infer_ppyoloe.py --model /home/aistudio/work/PaddleDetection/deploy/auto_compression/output --image=/home/aistudio/work/data_coco/test/2022-09-201700_85.jpg --device cpu --backend ort 出现以上报错,请问这个是什么问题呢?

weijingsu avatar Nov 10 '22 10:11 weijingsu

你可能用的老的量化方式,加载的模型是老的量化格式。

可以参考一下这个文档,里面是FD目前支持的一些量化模型,同时也支持相应模型的一键量化 https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/cn/quantize.md

jiangjiajun avatar Nov 10 '22 10:11 jiangjiajun

使用你的方法重新量化了,推理的时候还是出现报错。 /home/aistudio/work/FastDeploy/examples/vision/detection/paddledetection/quantize/python [INFO] fastdeploy/vision/common/processors/transform.cc(45)::FuseNormalizeCast Normalize and Cast are fused to Normalize in preprocessing pipeline. [INFO] fastdeploy/vision/common/processors/transform.cc(93)::FuseNormalizeHWC2CHW Normalize and HWC2CHW are fused to NormalizeAndPermute in preprocessing pipeline. [INFO] fastdeploy/vision/common/processors/transform.cc(159)::FuseNormalizeColorConvert BGR2RGB and NormalizeAndPermute are fused to NormalizeAndPermute with swap_rb=1 [Paddle2ONNX] [Info] The Paddle model is a quantized model. [Paddle2ONNX] Oops, there are some operators not supported yet, including masked_select, [ERROR] Due to the unsupported operators, the conversion is aborted.

weijingsu avatar Nov 10 '22 14:11 weijingsu

使用你的方法重新量化了,推理的时候还是出现报错。 /home/aistudio/work/FastDeploy/examples/vision/detection/paddledetection/quantize/python [INFO] fastdeploy/vision/common/processors/transform.cc(45)::FuseNormalizeCast Normalize and Cast are fused to Normalize in preprocessing pipeline. [INFO] fastdeploy/vision/common/processors/transform.cc(93)::FuseNormalizeHWC2CHW Normalize and HWC2CHW are fused to NormalizeAndPermute in preprocessing pipeline. [INFO] fastdeploy/vision/common/processors/transform.cc(159)::FuseNormalizeColorConvert BGR2RGB and NormalizeAndPermute are fused to NormalizeAndPermute with swap_rb=1 [Paddle2ONNX] [Info] The Paddle model is a quantized model. [Paddle2ONNX] Oops, there are some operators not supported yet, including masked_select, [ERROR] Due to the unsupported operators, the conversion is aborted. 你好, 1.你量化的是什么模型呢

  1. 你使用的Fastdeploy是什么版本呢

yunyaoXYY avatar Nov 10 '22 14:11 yunyaoXYY

你的这个是什么模型呢

jiangjiajun avatar Nov 10 '22 14:11 jiangjiajun

1、我量化的模型是ppyoloe_crn_s_300e_coco 2、Fastdeploy是fastdeploy-python==0.0.0 -f https://www.paddlepaddle.org.cn/whl/fastdeploy_nightly_build.html

weijingsu avatar Nov 10 '22 14:11 weijingsu

1、我量化的模型是ppyoloe_crn_s_300e_coco 2、Fastdeploy是fastdeploy-python==0.0.0 -f https://www.paddlepaddle.org.cn/whl/fastdeploy_nightly_build.html

这个ppyoloe的模型是从paddledetection导出的吗, 导出是怎样导出的呢. 方便的话, 可以发一下导出步骤, 我明天去复现一下.

yunyaoXYY avatar Nov 10 '22 14:11 yunyaoXYY

%cd /home/aistudio/work/PaddleDetection !python tools/export_model.py
-c configs/ppyoloe/ppyoloe_crn_s_300e_coco.yml
-o weights=output/ppyoloe_crn_s_300e_coco/model_final
trt=True #不包含NMS:trt=True exclude_post_process=True,包含:trt=True

weijingsu avatar Nov 10 '22 16:11 weijingsu

非常感谢,问题已经解决了,应该是模型导出的时候出了问题,重新导出量化就可以了。

weijingsu avatar Nov 10 '22 16:11 weijingsu

是因为模型导出时指定了--trt True的原因吗

jiangjiajun avatar Nov 10 '22 16:11 jiangjiajun

我把paddledetection更新到最新然后,重新导出模型,也可能是之前导出的模型不带nms。

weijingsu avatar Nov 11 '22 00:11 weijingsu

我把paddledetection更新到最新然后,重新导出模型,也可能是之前导出的模型不带nms。

看上面的导出命令,推测是因为加了trt True的原因。 这个参数不用加, FastDeploy无需这样导出部署

jiangjiajun avatar Nov 11 '22 00:11 jiangjiajun

此ISSUE由于一年未更新,将会关闭处理,如有需要,可再次更新打开。

jiangjiajun avatar Feb 06 '24 04:02 jiangjiajun