Ask Your Question

Error with custom trained SSD

asked 2017-10-22 04:37:30 -0600

bjorn89 gravatar image

updated 2017-10-26 06:53:09 -0600

berak gravatar image

Hi all,

I've trained a SSD network with custom dataset. The input is a 300x169 image (simply a scaled down fullHD image). I've tested the trained network on Ubuntu 16.04 and caffe, and it correctly classify. When I switch to windows, and I use my trained network with the Opencv example, I get the following error:

Assertion failed ((bias && l->blobs.size() == 2) || (!bias && l->blobs.size() == 1)) in cv::dnn::initConvDeconvLayerFromCaffe

How can I resolve?

PS: I'm using OpenCV 3.3 compiled with extra module.

EDIT As @dkurt suggested, I recompiled Opencv with the last release (3.3.1). I fixed the code in order to remove the deprecated function, and now when I run the program I get this error:

Assertion failed (blobs.size() != 0) in cv::dnn::ConvolutionLayerImpl::getMemoryShapes

if I run the net with the pretrained SSD prototxt, while I get

 Assertion failed (fracpart == 0.0) in cv::dnn::experimental_dnn_v2::DictValue::get

with the prototxt generated from caffe.

Here are the links of the prototxt I use: Original prototxt, generated with caffe: link text

Prototxt of the pretrained SSD downloaded from SSD repository, with changes in the layers to match the size of my images and the number of my classes: link text

edit retag flag offensive close merge delete


@bjorn89, Can you try it again but with the master branch? If problem is still alive, share with us at least a .prototxt config file or a minimal working example to reproduce a error.

dkurt gravatar imagedkurt ( 2017-10-25 08:13:31 -0600 )edit

@dkurt Hi. I compiled the 3.3.1 version, and now I get the error C4996 'cv::dnn::experimental_dnn_v2::createCaffeImporter': has been declared deprecated. Soon I'll edit the question with a link to the prototxt. Thanks!

bjorn89 gravatar imagebjorn89 ( 2017-10-26 06:23:44 -0600 )edit

@bjorn89, thank you! Fix of this problem is waiting to be merged. The easiest solution for now is to replace an every attribute min_size: 21.0 to integer value min_size: 21 (6 times with different values).

dkurt gravatar imagedkurt ( 2017-10-26 08:31:56 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-10-26 08:57:12 -0600

bjorn89 gravatar image

As @dkurt says, the min_size: 21.0 must be changed in min_size: 21. I tried this change and it works!

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-10-22 04:37:30 -0600

Seen: 1,189 times

Last updated: Oct 26 '17