Hello everyone!
I try to load the yolo5 model as onnx into the cv2 using the following line:
yolo = cv2.dnn.readNetFromONNX('Model/weights/best.onnx')
However, when I run the code, I receive this big error chunk:
[ERROR:0@0.673] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/dnn/src/onnx/onnx_importer.cpp (1021) handleNode DNN/ONNX: ERROR during processing node with 2 inputs and 3 outputs: [Split]:(onnx_node!/model.24/Split) from domain='ai.onnx'
Traceback (most recent call last):
File "/Users/diasmashikov/Desktop/object-detection-yolo/yolo_predictions.py", line 17, in <module>
yolo = cv2.dnn.readNetFromONNX('Model/weights/best.onnx')
cv2.error: OpenCV(4.6.0) /Users/runner/work/opencv-python/opencv-python/opencv/modules/dnn/src/onnx/onnx_importer.cpp:1040: error: (-2:Unspecified error) in function 'handleNode'
> Node [Split@ai.onnx]:(onnx_node!/model.24/Split) parse error: OpenCV(4.6.0) /Users/runner/work/opencv-python/opencv-python/opencv/modules/dnn/src/layers/slice_layer.cpp:235: error: (-215:Assertion failed) splits > 0 && inpShape[axis_rw] % splits == 0 in function 'getMemoryShapes'
My Python version is 3.9.13
I tried OpenCV(installed using pip install opencv-python) versions: 4.40.44, 4.6.0.66, 4.7.0.x
Still, none of them work. Does anyone know to solve the problem?