object-detection-opencv-rust icon indicating copy to clipboard operation
object-detection-opencv-rust copied to clipboard

Error in Incompatibility between the ONNX model format and the OpenCV DNN module

Open louis013 opened this issue 1 year ago • 4 comments

Pretty much what the title stated. I am having error when running the code. This is the exact error:

[ERROR:[email protected]] global ./modules/dnn/src/onnx/onnx_importer.cpp (1018) handleNode DNN/ONNX: ERROR during processing node with 2 inputs and 1 outputs: [Reshape]:(onnx_node!/model.22/dfl/Reshape) from domain='ai.onnx'
thread 'main' panicked at src/main.rs:20:161:
called `Result::unwrap()` on an `Err` value: Error { code: "StsError, -2", message: "OpenCV(4.6.0) ./modules/dnn/src/onnx/onnx_importer.cpp:1040: error: (-2:Unspecified error) in function 'handleNode'\n> Node [[email protected]]:(onnx_node!/model.22/dfl/Reshape) parse error: OpenCV(4.6.0) ./modules/dnn/src/layers/reshape_layer.cpp:108: error: (-215:Assertion failed) total(srcShape, srcRange.start, srcRange.end) == maskTotal in function 'computeShapeByReshapeMask'\n> " }

I used the opencv = 0.91.3 which is the dependency of od_opencv. I am having issue if I used the latest version of opencv so I decided to use the version that it depends.

louis013 avatar Dec 18 '24 06:12 louis013