iwatake2222 / opencv_sample

OpenCV Sample Code in C++
Apache License 2.0
56 stars 13 forks source link

face detection onnx: dynamic 'zero' shapes are not supported #4

Closed fisakhan closed 2 years ago

fisakhan commented 2 years ago

While running face detection, net_ = cv::dnn::readNetFromONNX(model_filename);, throws the following error. Can you please help me how to solve this problem?

[ERROR:0@0.003] global /home/opencv_build/opencv/modules/dnn/src/onnx/onnx_importer.cpp (2564) parseShape DNN/ONNX(Shape): dynamic 'zero' shapes are not supported, input 243 [ 0 0 0 51 ] [ERROR:0@0.003] global /home/opencv_build/opencv/modules/dnn/src/onnx/onnx_importer.cpp (1042) handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [Shape]:(onnx_node!Shape_70) from domain='ai.onnx' terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.6.0-dev) /home/opencv_build/opencv/modules/dnn/src/onnx/onnx_importer.cpp:1064: error: (-2:Unspecified error) in function 'handleNode'

Node [Shape@ai.onnx]:(onnx_node!Shape_70) parse error: OpenCV(4.6.0-dev) /home/opencv_build/opencv/modules/dnn/src/onnx/onnx_importer.cpp:2565: error: (-215:Assertion failed) !isDynamicShape in function 'parseShape'

Aborted (core dumped)

iwatake2222 commented 2 years ago

Which project(folder) are you running?

Assuming you are trying dnn_face, everything works fine in my environment (Windows 11 + OpenCV4.5.5). Can you try with this version?

fisakhan commented 2 years ago

Which project(folder) are you running?

Assuming you are trying dnn_face, everything works fine in my environment (Windows 11 + OpenCV4.5.5). Can you try with this version?

Thanks @iwatake2222, yes dnn_face. May be I need to downgrade the version of OpenCV from 4.6.0 to 4.5.5 and see if it is working. https://github.com/opencv/opencv/issues/22139 this also describes a similar problem.

iwatake2222 commented 2 years ago

This issue was closed because it has been inactive.