Opencv调用yolov5的onnx文件时报错记录
报错内容:
Error: Unspecified error (> Node [Pow@ai.onnx]:(onnx_node!/model.24/Pow) parse error: OpenCV(4.6.0) F:\opencv-4.6.0\opencv-4.6.0\modules\dnn\src\onnx\onnx_importer.cpp:601: error: (-215:Assertion failed) shapeIt != outShapes.end() in function 'cv::dnn::dnn4_v20220524::ONNXImporter::addLayer'
解决方法:
修改export.py中的:
parser.add_argument("--opset", type=int, default=11, help="ONNX: opset version")
将default = 15修改为11.