cv2.dnn read model error:
D:\ProgramData\Miniconda3\python.exe D:/project/detect/face/yolov5-face-landmarks-opencv/main_new.py [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\dnn\src\onnx\onnx_importer.cpp (1878) cv::dnn::dnn4_v20201117::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 2 inputs and 1 outputs: [Add]:(430) Traceback (most recent call last): File "D:/project/detect/face/yolov5-face-landmarks-opencv/main_new.py", line 126, in <module> yolonet = yolov5(confThreshold=args.confThreshold, nmsThreshold=args.nmsThreshold, objThreshold=args.objThreshold) File "D:/project/detect/face/yolov5-face-landmarks-opencv/main_new.py", line 23, in __init__ self.net = cv2.dnn.readNet(r'D:\project\detect\face\yolov5-face-master\yolov5n-face.onnx') cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\dnn\src\onnx\onnx_importer.cpp:1887: error: (-2:Unspecified error) in function 'cv::dnn::dnn4_v20201117::ONNXImporter::handleNode' > Node [Add]:(430) parse error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\dnn\src\onnx\onnx_importer.cpp:780: error: (-215:Assertion failed) blob_0.size == blob_1.size in function 'cv::dnn::dnn4_v20201117::ONNXImporter::handleNode' > Process finished with exit code 1
Reason:
opencv4.5.1 torch 1.9.0
torch1.9.0 export onnx,opencv4.5.1not supported
Solution:
torch change to version 1.7.1, torchvision 0.8.2 version —–the other version wil report an error.
Read More:
- [Solved] Compile the program error: undefined reference to `cv::dnn::dnn4_v20210301::Net::~Net()‘
- [Solved] Opencv Calls PB Model Error: cv2.error: OpenCV(4.2.0)…
- [Solved] OpenCV Error: AttributeError: module ‘cv2‘ has no attribute ‘data‘
- Vitis-AI Generate a Quantitative Model: NotImplementedError
- [Solved] Android Studio Error: Use of undeclared identifier ‘cv‘
- [Solved] C++ reason ncnn model error: Segmentation fault (core dumped)
- [Solved] error: ‘CV_GRAY2BGR’ was not declared in this scope
- OpenCV4 Error: imread(argv[1], CV_LOAD_IMAGE_COLOR);
- [Solved] import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- [Solved] Pytorch loading model specified GPU card number error or failed to specify
- Onnx to tensorrt model error [How to Solve]
- [Solved] Instantiation of ‘sdram_model_plus‘ failed. The design unit was not found.
- EF core Creates pg library and Model Report an Error [Solved]
- [Solved] Opencv Error: Error: Assertion failed (data) in cv::Mat::at, file … mat.inl.hpp, line 897(Accessed pixels of non-existent matrix)
- How to Solve Keras calls plot_model error
- Laravel model save if the table has no ID field Error [How to Solve]
- Deep learning model error + 1: CUDA error: device side assert triggered
- Maskrcnn-benchmark Error: KeyError “Non-existent config key: MODEL.BACKBONE.OUT_CHANNELS“
- Kubernetes Error: Error in configuration: unable to read client-cert* unable to read client-key*