Skip to content

onnx file of custom trained yolov5 is not loading #2666

@faheem-khaskheli

Description

@faheem-khaskheli

🐛 Bug

i exported my custom trained yolo v5 model weights using models/export.py
but this file is not working with cv2.dnn.readNetFromONNX or cv2.dnn.readNet

Error on my local machine

Cannot load torch model OpenCV(4.4.0) /tmp/pip-req-build-nzyrw1vf/opencv/modules/dnn/src/onnx/onnx_importer.cpp:562: error: (-2:Unspecified error) in function 'void cv::dnn::dnn4_v20200609::ONNXImporter::populateNet(cv::dnn::dnn4_v20200609::Net)'

Slice layer only supports steps = 1 (expected: 'countNonZero(step_blob != 1) == 0'), where
'countNonZero(step_blob != 1)' is 1
must be equal to
'0' is 0

Error on Colab

error: OpenCV(4.1.2) /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp:101: error: (-211:One of the arguments' values is out of range) Input is out of OpenCV 32S range in function 'convertInt64ToInt32

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleStale and schedule for closing soonbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions