yolov5-opencv-cpp-python icon indicating copy to clipboard operation
yolov5-opencv-cpp-python copied to clipboard

error: (-215:Assertion failed) inputs.size() in function 'getMemoryShapes'

Open HerrAskinSM opened this issue 3 years ago • 1 comments

Hello! I'm trying to run the code for c++ ./yolo_example code with yolov5s.onnx, which was converted by the python command export.py --weights yolov5s.pt --include onnx. I get an error

[ERROR:[email protected]] global /home/sergey/opencv/modules/dnn/src/onnx/onnx_importer.cpp (906) handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [Identity]:(onnx::Reshape_475) from domain='ai.onnx' terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.5.5) /home/sergey/opencv/modules/dnn/src/onnx/onnx_importer.cpp:928: error: (-2:Unspecified error) in function 'handleNode' Node [[email protected]]:(onnx::Reshape_475) parse error: OpenCV(4.5.5) /home/sergey/opencv/modules/dnn/src/dnn.cpp:6017: error: (-215:Assertion failed) inputs.size() in function 'getMemoryShapes' Aborted (core dumped)

P.S. but the native yolov5.onnx works fine.

HerrAskinSM avatar Sep 02 '22 08:09 HerrAskinSM

I solve my issue. https://github.com/ultralytics/yolov5/issues/8744#issuecomment-1196926862

HerrAskinSM avatar Sep 02 '22 13:09 HerrAskinSM