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] size_from_dim: Assertion `dim >= 0 && (size_t)dim < sizes_.size()` failed.
- VSCode Error: collect2.exe:error:1d returned 1 exit status [How to Solve]
- [Solved] Opencv Compile Error: (CMake Error: The following variables are used in this project, but they are set to not)
- [Solved] Error: Cannot find module ‘webpack-cli/package.json‘
- RuntimeError: ONNX export failed: Couldn‘t export operator aten::upsample_bilinear2d
- How to Solve Opencv Error: CPP: 1557 error
- Vitis-AI Generate a Quantitative Model: NotImplementedError
- RuntimeError: CUDNN_STATUS_EXECUTION_FAILED [How to Solve]
- Conda create New environment Error: An unexpected error has occurred. Conda has prepared the above report.
- [Solved] Compile the program error: undefined reference to `cv::dnn::dnn4_v20210301::Net::~Net()‘
- [Solved] OpenCV Error: AttributeError: module ‘cv2‘ has no attribute ‘data‘
- Cli Write Error: This is related to npm not being able to find a file. [Solved]
- Error Report of Yarn Create UMI
- Arduino cache multiple definition error [How to Solve]
- [Solved] ORB_SLAM3 Compile Error: opencv4.0 not found four
- [Solved] python Connect hive to Install sasl Error: Building wheel for sasl (setup.py) … error
- RuntimeError: Exporting the operator uniform to ONNX opset version 12 is not supported.
- [Solved] pytorch Load Error: “RuntimeError: Error(s) in loading state_dict for Sequential:”
- [Solved] error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows,
- NPM Install Error: npm ERR! ERESOLVE unable to resolve dependency tree