Assertion failed at dnn allocateLayers

asked 2018-04-04 02:24:13 -0600

KlaimNod gravatar image

updated 2018-04-04 02:25:16 -0600

Hello,

On trying to run detection network from prototxt and caffemodel in opencv, I am running into Assertion failed issue. The net is created as expected and the input blob is of the right dimension but on trying to access the output of the net, I run into the issue given below; image description

The code is

String modelConfiguration = "D:/test_SSH.prototxt";
String modelBinary = "D:/SSH.caffemodel";

dnn::Net net = readNetFromCaffe(modelConfiguration, modelBinary);
Mat imgOrig = imread("path/to/img");
resize(imgOrig, imgOrig, Size(224, 224));
Mat inBlob = blobFromImage(imgOrig, 1, Size(224, 224), Scalar::all(0), false, false);
net.setInput(inBlob, "data");
Mat out = net.forward();

Any help or suggestion to solve this issue is greatly appreciated. Thanks!

edit retag flag offensive close merge delete

Comments

can you please replace the screenshot of your error with a TEXT version (so ppl can quote you correctly) ?

berak gravatar imageberak ( 2018-04-04 02:25:55 -0600 )edit
1

@KlaimNod, @berak, it looks like a duplicate of http://answers.opencv.org/question/18... . A bug is confirmed.

dkurt gravatar imagedkurt ( 2018-04-04 02:37:43 -0600 )edit

@dkurt It is! Thanks!

KlaimNod gravatar imageKlaimNod ( 2018-04-04 02:40:27 -0600 )edit
dkurt gravatar imagedkurt ( 2018-04-04 07:15:52 -0600 )edit