使用的是这一断代码
file_model = 'best_cup.onnx'
net = cv2.dnn.readNetFromONNX(file_model)
报错信息
[ERROR:0@0.059] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp (1021) cv::dnn::dnn4_v20220524::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [Identity]:(onnx_node!Identity_0) from domain='ai.onnx'
你是不是导出动态输入了?opencv不支持动态推理目前,只能以固定的NCHW导出
最后还是用了onnxruntime来做onnx模型