Error running inference on Single Shot Scale-invariant Face Detector pre trained model

asked 2017-12-18 08:55:56 -0600

fabito gravatar image

updated 2017-12-18 09:17:54 -0600

Hi,

I'm trying to use the pre trained models from Single Shot Scale-invariant Face Detector. I can load the network successfully but when I try to invoke net.forward the following exception is being raised:

3.3.1:

OpenCV Error: Bad argument (PriorBox layer parameter does not contain flip parameter.) in getParameter, file /opt/opencv-3.3.1/modules/dnn/src/layers/prior_box_layer.cpp, line 87
terminate called after throwing an instance of 'cv::Exception'
  what():  /opt/opencv-3.3.1/modules/dnn/src/layers/prior_box_layer.cpp:87: error: (-5) PriorBox layer parameter does not contain flip parameter. in function getParameter

Aborted (core dumped)

3.4.0-rc:

[ INFO:0] Initialize OpenCL runtime...
OpenCV Error: Assertion failed (!_aspectRatios.empty()) in PriorBoxLayerImpl, file /opt/opencv-3.4.0-rc/modules/dnn/src/layers/prior_box_layer.cpp, line 206
terminate called after throwing an instance of 'cv::Exception'
  what():  /opt/opencv-3.4.0-rc/modules/dnn/src/layers/prior_box_layer.cpp:206: error: (-215) !_aspectRatios.empty() in function PriorBoxLayerImpl

Aborted (core dumped)

Any help is appreciated.

edit retag flag offensive close merge delete

Comments

@fabito, try to remove this assertion.

dkurt gravatar imagedkurt ( 2017-12-18 09:18:54 -0600 )edit

Hi @dkurt, the good news is that I removed the assertion and it worked!! The bad news is that the net.forward is VERY slow: ~0.22 FPS. Maybe its because my OpenCV its not GPU/Cuda enabled. According to the paper it should run at 36 FPS on a Nvidia Titan X (Pascal) for VGA-resolution images

fabito gravatar imagefabito ( 2017-12-18 18:43:10 -0600 )edit

@fabito@dkurt i have same error, may i know how assertion can be removed in this issue?

krishnapra gravatar imagekrishnapra ( 2018-02-26 07:24:11 -0600 )edit

same problem, also tried with 3.4.1 build. error is /io/opencv/modules/dnn/src/layers/prior_box_layer.cpp:207: error: (-215) !_aspectRatios.empty() in function PriorBoxLayerImpl

0xFAFAFA gravatar image0xFAFAFA ( 2018-03-25 10:59:48 -0600 )edit

@0xFAFAFA, please try the latest version of OpenCV. The problem has been fixed a day ago by https://github.com/opencv/opencv/pull.... Thanks!

dkurt gravatar imagedkurt ( 2018-03-25 23:34:33 -0600 )edit