Giter Club home page Giter Club logo

terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.5.4) ./modules/dnn/src/onnx/onnx_importer.cpp:739: error: (-2:Unspecified error) in function 'handleNode' > Node [Identity]:(onnx::Reshape_395) parse error: OpenCV(4.5.4) ./modules/dnn/src/dnn.cpp:5653: error: (-215:Assertion failed) inputs.size() in function 'getMemoryShapes' about opencv HOT 4 OPEN

mike55688 avatar mike55688 commented on June 1, 2024
terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.5.4) ./modules/dnn/src/onnx/onnx_importer.cpp:739: error: (-2:Unspecified error) in function 'handleNode' > Node [Identity]:(onnx::Reshape_395) parse error: OpenCV(4.5.4) ./modules/dnn/src/dnn.cpp:5653: error: (-215:Assertion failed) inputs.size() in function 'getMemoryShapes'

from opencv.

Comments (4)

LaurentBerger avatar LaurentBerger commented on June 1, 2024 2

first update yourcode to opencv 4.9

from opencv.

LaurentBerger avatar LaurentBerger commented on June 1, 2024 1

Why opencv 4.7.0 (december 2022)?
Take a look at https://github.com/opencv/opencv/wiki/ChangeLog#version490 and you will see how many bug and patch since opencv 4.7.
Yolov7 (https://github.com/WongKinYiu/yolov7) is two years old.

from opencv.

mike55688 avatar mike55688 commented on June 1, 2024 1

Hello
I updated opencv to 4.9.0, and the previous problems did not occur. Thank you for your assistance.

from opencv.

mike55688 avatar mike55688 commented on June 1, 2024

Hello
I have updated my opencv version to 4.7.0 but it still has this problem!

$ conda list opencv

packages in environment at /home/mk/anaconda3:

Name Version Build Channel

libopencv 4.7.0 py311h7a0761e_1 conda-forge
opencv 4.7.0 py311h38be061_1 conda-forge
py-opencv 4.7.0 py311h781c19f_1 conda-forge
----------------------------problem----------------------------------------
(base) mk@mk-ROG-Flow-X16-GV601VI-GV601VI:~/visp-ws/visp-build/tutorial/detection/dnn$ ./tutorial-dnn-object-detection-live --input-json ./default_yolov7.json
Video device : 0
Label file (optional): None
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (1100) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Model : /home/mk/visp-ws/visp-build/tutorial/detection/dnn/yolov7/yolov7-tiny.onnx
Type : yolov7
Config (optional): "None"
Framework (optional): onnx
Width x Height : 640 x 640
Mean RGB : 0.000000 0.000000 0.000000
Scale : 0.003922
Swap RB? : false
Confidence threshold : 0.500000
NMS threshold : 0.500000
Filter threshold : disabled

Caught an exception trying to run inference:
OpenCV(4.5.4) ./modules/dnn/include/opencv2/dnn/shape_utils.hpp:170: error: (-215:Assertion failed) start <= (int)shape.size() && end <= (int)shape.size() && start <= end in function 'total'

Cuda and/or GPU driver might not be correctly installed. Setting preferable backend to CPU and trying again.
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.5.4) ./modules/dnn/include/opencv2/dnn/shape_utils.hpp:170: error: (-215:Assertion failed) start <= (int)shape.size() && end <= (int)shape.size() && start <= end in function 'total'

Aborted (core dumped)

from opencv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.