iArunava / YOLOv3-Object-Detection-with-OpenCV

This project implements a real-time image and video object detection classifier using pretrained yolov3 models.
MIT License
320 stars 173 forks source link

error: (-215:Assertion failed) blobs.size() != 0 in function 'getMemoryShapes' #9

Open joeljosephjin opened 5 years ago

joeljosephjin commented 5 years ago

I was trying to run "!python3 yolo.py --image-path='test.jpg'". And then the following error comes up:

Traceback (most recent call last): File "yolo.py", line 110, in img, , , , = infer_image(net, layer_names, height, width, img, colors, labels, FLAGS) File "/content/drive/My Drive/Papers and Stuff/YOLOv3-Object-Detection-with-OpenCV/yolo_utils.py", line 77, in infer_image outs = net.forward(layer_names) cv2.error: OpenCV(3.4.3) /io/opencv/modules/dnn/src/layers/convolution_layer.cpp:233: error: (-215:Assertion failed) blobs.size() != 0 in function 'getMemoryShapes'

fspider commented 4 years ago

I also found this error I am using my own YOLO v3 model on Android+Opencv4.1.1

======================== 1 Mat blob; 2 cv::dnn::blobFromImage(frame, blob, 0.00392, Size(416, 416), Scalar(0, 0, 0), true, false); 3 my_net.setInput(blob); 4 vector<Mat> outs; 5 my_net.forward(outs, getOutputsNames());

This code works well with Visual Studio 2017 But after implement on Android NDK, on 5th line, i could get this error

E/cv::error(): OpenCV(4.1.1) Error: Assertion failed (blobs.size() != 0) in getMemoryShapes, file /build/master_pack-android/opencv/modules/dnn/src/layers/convolution_layer.cpp, line 278 E/libc++abi: terminating with uncaught exception of type cv::Exception: OpenCV(4.1.1) /build/master_pack-android/opencv/modules/dnn/src/layers/convolution_layer.cpp:278: error: (-215:Assertion failed) blobs.size() != 0 in function 'getMemoryShapes' A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 29632 (Thread-5)