Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assertion failed at dnn allocateLayers

Hello,

On trying to run detection network from prototxt and caffemodel in opencv, I am running into the below 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!

Assertion failed at dnn allocateLayers

Hello,

On trying to run detection network from prototxt and caffemodel in opencv, I am running into the below 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!