Cv2 loads the training model abnormally

I use yolov5 to train the model, and the verification model is normal, but after converting the onnx model, the verification is also successful; but with cv2, the loading model reports an error, the specific exception: [ERROR:0@0.011] global onnx_importer.cpp:1054 cv::dnn::dnn4_v20221220::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 3 inputs and 1 outputs: [Conv]:(onnx_node!/model.2/cv1/conv/Conv) from domain=‘ai.onnx’
Traceback (most recent call last):
File “D:\Demo\yolov5\”, line 2, in
net = cv2.dnn.readNetFromONNX(‘mybest.onnx’)
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:1073: error: (-2:Unspecified error) in function ‘cv::dnn::dnn4_v20221220::ONNXImporter::handleNode’

Node [Conv@ai.onnx]:(onnx_node!/model.2/cv1/conv/Conv) parse error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:394: error: (-215:Assertion failed) !hasBias() || blobs[1].total() == (size_t)weightShape[0] in function ‘cv::dnn::ConvolutionLayerImpl::getMemoryShapes’

when exporting your model to onnx, make sure to use

python --opset 12 [...more args...]

(by default, it’s using opset 13, leading to above errors)