Error while trying to run the dnn for object detection

asked 2018-02-03 05:18:58 -0500

pedrolima gravatar image

updated 2018-02-03 08:29:47 -0500

I'm following the tutorial on how to do object detection using opencv 3.4 and mobilenet, but I have a problem when runnning this error appears, I already have created the graph.txt from the .pb file.

OpenCV Error: Assertion failed (!_aspectRatios.empty(), _minSize > 0) in cv::dnn
::PriorBoxLayerImpl::PriorBoxLayerImpl, file D:\Build\OpenCV\opencv-3.4.0\module
s\dnn\src\layers\prior_box_layer.cpp, line 207
Traceback (most recent call last):
  File "", line 11, in <module>
    cvOut = cvNet.forward()
cv2.error: D:\Build\OpenCV\opencv-3.4.0\modules\dnn\src\layers\prior_box_layer.c
pp:207: error: (-215) !_aspectRatios.empty(), _minSize > 0 in function cv::dnn::
edit retag flag offensive close merge delete


Please add more details. The source of the model, references to tutorial and all the mentioned files. Otherwise that question looks like "I can't load a .PNG image". Thank you!

dkurt gravatar imagedkurt ( 2018-02-03 05:35:45 -0500 )edit

Is the exact source as in the tutorial. I'm following this tutorial:, I've used both MobileNet 1 and 2.

pedrolima gravatar imagepedrolima ( 2018-02-04 06:52:35 -0500 )edit

I have the same problem at forward stages.

MinxiangLiu gravatar imageMinxiangLiu ( 2018-02-05 07:26:14 -0500 )edit

@pedrolima, @MinxiangLiu, Unfortunately, I can't reproduce it. TensorFlow 1.4.1, OpenCV 3.4.0-dev (revision ssd_mobilenet_v1_coco_2017_11_17.

dkurt gravatar imagedkurt ( 2018-02-05 07:38:10 -0500 )edit