OpenGVLab / InternImage

[CVPR 2023 Highlight] InternImage: Exploring Large-Scale Vision Foundation Models with Deformable Convolutions
https://arxiv.org/abs/2211.05778
MIT License
2.54k stars 237 forks source link

使用DCNv3_pytorch 训练的分割模型,导出onnx后,还是存在不支持的onnx node #286

Open ZJDATY opened 7 months ago

ZJDATY commented 7 months ago

我是win10环境,参考这篇文章,成功训练。 https://github.com/OpenGVLab/InternImage/issues/160 https://github.com/OpenGVLab/InternImage/issues/201

我想使用openvino C++部署,使用onnx作为中间层转换。 使用export的教程,得到end2end.onnx https://github.com/OpenGVLab/InternImage/tree/master/segmentation#export 转到IR模型时,遇到不支持的onnx节点。报错如下 mo --input_model end2end.onnx


[ ERROR ]  -------------------------------------------------
[ ERROR ]  ----------------- INTERNAL ERROR ----------------
[ ERROR ]  Unexpected exception happened.
[ ERROR ]  Please contact Model Optimizer developers and forward the following information:
[ ERROR ]  Check 'error_message.empty()' failed at src\frontends\onnx\frontend\src\frontend.cpp:124:
OpenVINO does not support the following ONNX operations: mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.
TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3,
 mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy
.TRTDCNv3, mmdeploy.TRTDCNv3, mmdeploy.TRTDCNv3

继而发现了这个issues。 https://github.com/OpenGVLab/InternImage/issues/61

接着 参考了下面这篇issues的回复,修改core_op='DCNv3_pytorch', https://github.com/OpenGVLab/InternImage/issues/41

报错如下,不支持的节点 由 mmdeploy.TRTDCNv3 ,变为了 mmdeploy.grid_sampler,想请教一下cpu推理不build mmdeploy后端,怎么使用?


[ ERROR ]  -------------------------------------------------
[ ERROR ]  ----------------- INTERNAL ERROR ----------------
[ ERROR ]  Unexpected exception happened.
[ ERROR ]  Please contact Model Optimizer developers and forward the following information:
[ ERROR ]  Check 'error_message.empty()' failed at src\frontends\onnx\frontend\src\frontend.cpp:124:
OpenVINO does not support the following ONNX operations: mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampl
er, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmd
eploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.g
rid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler, mmdeploy.grid_sampler
tzhang2014 commented 6 months ago

在导出onnx时把opset 那个设为16或以上就可以了

ZJDATY commented 6 months ago

在导出onnx时把opset 那个设为16或以上就可以了

你好,你测试成功了吗?你可以帮忙打印一下 pip list吗? 我本身安装的就是新版本的onnx 和onnx_runtime. 但是当我把默认导出的opset_version由11改为16时,它会提示不支持。 image 是否可能是mmdeploy的版本较老。 image

tzhang2014 commented 5 months ago

我的onnx是1.14.0 ,onnxruntime是1.16.1