hpc203 / yolov5-dnn-cpp-python

用opencv的dnn模块做yolov5目标检测,包含C++和Python两个版本的程序

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cv2.error:

jsjs0827 opened this issue · comments

pytorch1.7.1 cv2 4.3.0 win10
I download the yolov5s.pth then I run the convert_onnx.py,the onnx file ran normally,but in the end of convert_onnx.py dnnnet = cv2.dnn.readNet(output_onnx) failed:error: (-212:Parsing error) Input node with name 873 not found in function 'cv::dnn::Subgraph::getInputNodeId'

~/code/cplus/yolov5-dnn-cpp-python/build$ ./opencv_test_project
Net use yolov5s
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.5.0) /home/code/opencv-4.5.0/modules/dnn/src/onnx/onnx_importer.cpp:73: error: (-5:Bad argument) Can't read ONNX file: yolov5s.onnx in function 'ONNXImporter'