hpc203 / yolov5-dnn-cpp-python

用opencv的dnn模块做yolov5目标检测,包含C++和Python两个版本的程序

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

run c++ main_yolo.cpp error

masommao opened this issue · comments

OpenCV(4.0.0) Error: Requested object was not found (Blob 363 not found in const blobs) in cv::dnn::dnn4_v20180917::ONNXImporter::getBlob, file c:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\onnx\onnx_importer.cpp, line 272

opencv版本要升级一下,最好在4.4及其以上的版本

版本4.5 仍然报错呢

/yolov5-dnn-cpp-python/build$ ./opencv_test_project
Net use yolov5s
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.5.3-pre) /home/code/opencv/modules/dnn/src/onnx/onnx_importer.cpp:78: error: (-5:Bad argument) Can't read ONNX file: yolov5s.onnx in function 'ONNXImporter'

Aborted (core dumped)

:~/code/cplus/yolov5-dnn-cpp-python/build$ ./opencv_test_project
Net use yolov5s
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.5.0) /home/code/opencv-4.5.0/modules/dnn/src/onnx/onnx_importer.cpp:73: error: (-5:Bad argument) Can't read ONNX file: yolov5s.onnx in function 'ONNXImporter'