Ask Your Question
0

Error with custom trained SSD

asked Oct 22 '17

bjorn89 gravatar image

updated Oct 26 '17

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

Preview: (hide)

Comments

@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 (Oct 25 '17)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 (Oct 26 '17)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 (Oct 26 '17)edit

1 answer

Sort by » oldest newest most voted
1

answered Oct 26 '17

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!

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Oct 22 '17

Seen: 1,229 times

Last updated: Oct 26 '17