Skip to content

run onnx model in opencv #713

@hrshovon

Description

@hrshovon

❔Question

Hello all,
I trained yolov5 on my own data and created onnx model using the export script. The coreml model failed but onnx model was created successfully. But when I try to import this model in opencv(4.3.0-dev and 4.4.0-dev), I get the following error:
`cv2.error: OpenCV(4.4.0-dev) /tmp/ocv_bld/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`
How can I solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleStale and schedule for closing soonquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions