(-215:Assertion failed) inputs.size() in function 'cv::dnn::dnn4_v20211004::Layer::getMemoryShapes'

Viewed 28

I am doing a text extraction on specific regions using Yolov5. I trained a model and convert it to onnx formate for OpenCV readable formate.. but when I load the model weight this error occurs.. all stack, GitHub issues are not able to solve my problem. I download graded my torch version according to Github resolved issues but my issue is still there. Kindly if anyone has an idea about this error contact me plz. I am very glad to receive your message. Best regards. Error is below

[ERROR:0] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp (720) cv::dnn::dnn4_v20211004::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [Identity]:(onnx::Resize_445)
Traceback (most recent call last):
  File "C:\Users\Python_Coder\Desktop\YOLO_T_ID\Custom-OCR-with-YOLO\Custom_OCRs.py", line 176, in <module>
    net = cv2.dnn.readNet(modelWeights)
cv2.error: OpenCV(4.5.4) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:739: error: (-2:Unspecified error) in function 'cv::dnn::dnn4_v20211004::ONNXImporter::handleNode'
> Node [Identity]:(onnx::Resize_445) parse error: OpenCV(4.5.4) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\dnn.cpp:5653: error: (-215:Assertion failed) inputs.size() in function 'cv::dnn::dnn4_v20211004::Layer::getMemoryShapes'

OpenCV error with PyTorch model loading

0 Answers
Related