.pt to .onnx conversion using u5 branch export.py #638
Description
I converted a custom yolov7 pt file to onnx but when I try to do inference with cv2.dnn module I keep getting the error
Can't create layer "onnx_node!ScatterND_243" of type "ScatterND" in function 'getLayerInstance'
Full error:
[ERROR:0@0.055] global /home/efedmrlr/Desktop/opencv/modules/dnn/src/onnx/onnx_importer.cpp (1041) handleNode DNN/ONNX: ERROR during processing node with 3 inputs and 1 outputs: [ScatterND]:(onnx_node!ScatterND_243) from domain='ai.onnx'
Traceback (most recent call last):
File "main.py", line 161, in
yolov7_detector = YOLOv7(args.modelpath, conf_thres=args.confThreshold, iou_thres=args.nmsThreshold)
File "main.py", line 13, in init
self.net = cv2.dnn.readNet(path)
cv2.error: OpenCV(4.6.0-dev) /home/efedmrlr/Desktop/opencv/modules/dnn/src/onnx/onnx_importer.cpp:1063: error: (-2:Unspecified error) in function 'handleNode'
Node [ScatterND@ai.onnx]:(onnx_node!ScatterND_243) parse error: OpenCV(4.6.0-dev) /home/efedmrlr/Desktop/opencv/modules/dnn/src/layer_internals.hpp:110: error: (-2:Unspecified error) Can't create layer "onnx_node!ScatterND_243" of type "ScatterND" in function 'getLayerInstance'
Note: I can export and use the example yolov7.pt coco weights but cant use my custom model.