hpc203 / yolov5-dnn-cpp-python-v2

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

opencv error

coordxyz opened this issue · comments

I have problem of loading onnx model by opencv. How to fix it? Thx.
pytorch 1.7.1
opencv 4.3.0
Here is the detail:

python main_yolov5.py --net_type yolov5s
Traceback (most recent call last):
File "main_yolov5.py", line 110, in
yolonet = yolov5(args.net_type, confThreshold=args.confThreshold, nmsThreshold=args.nmsThreshold, objThreshold=args.objThreshold)
File "main_yolov5.py", line 21, in init
self.net = cv2.dnn.readNet(yolo_type + '.onnx')

cv2.error: OpenCV(4.3.0) /io/opencv/modules/dnn/src/graph_simplifier.cpp:79: error: (-212:Parsing error) Input node with name 925 not found in function 'getInputNodeId'

try opencv4.5.1