hpc203 / yolopv2-opencv-onnxrun-cpp-py

分别使用OpenCV、ONNXRuntime部署YOLOPV2目标检测+可驾驶区域分割+车道线分割,一共包含54个onnx模型,依然是包含C++和Python两个版本的程序。仅仅只依赖OpenCV就能运行,彻底摆脱对任何深度学习框架的依赖。
70 stars 8 forks source link

Opencv dnn onnx_importer.cpp failed #4

Open XinnWang opened 1 year ago

XinnWang commented 1 year ago

Thanks for the sharing. I tried the opencv code to import onnx/yolopv2_480x640.onnx but failed. My terminal output is

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.4.0) /tmp/third_party/opencv-4.4.0/modules/dnn/src/onnx/onnx_importer.cpp:1410: error: (-2:Unspecified error) in function 'void cv::dnn::dnn4_v20200609::ONNXImporter::populateNet(cv::dnn::dnn4_v20200609::Net)'
>  (expected: 'shapes.depth() == CV_32S'), where
>     'shapes.depth()' is 5 (CV_32FC1)
> must be equal to
>     'CV_32S' is 4 (CV_32SC1)

Aborted (core dumped)

Have you met this before? How can i fix this? Thanks.

hpc203 commented 1 year ago

您的opencv版本是4.4的,需要升级opencv

---Original--- From: @.> Date: Fri, Dec 2, 2022 17:43 PM To: @.>; Cc: @.***>; Subject: [hpc203/yolopv2-opencv-onnxrun-cpp-py] Opencv dnn onnx_importer.cppfailed (Issue #4)

Thanks for the sharing. I tried the opencv code to import onnx/yolopv2_480x640.onnx but failed. My terminal output is terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.4.0) /tmp/third_party/opencv-4.4.0/modules/dnn/src/onnx/onnx_importer.cpp:1410: error: (-2:Unspecified error) in function 'void cv::dnn::dnn4_v20200609::ONNXImporter::populateNet(cv::dnn::dnn4_v20200609::Net)' > (expected: 'shapes.depth() == CV_32S'), where > 'shapes.depth()' is 5 (CV_32FC1) > must be equal to > 'CV_32S' is 4 (CV_32SC1) Aborted (core dumped)
Have you met this before? How can i fix this? Thanks.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>