Assertion failed at getMemoryShapes in dnn
Hello!
I've been trying to run a face detector by using FaceBoxes (https://github.com/zeusees/FaceBoxes) by creating a network via the use of readNetFromCaffe and prototext, caffemodel available there. But when I try to obtain the output of the 'net' I create I run into the following issue;
String modelConfiguration = "D:/FaceBoxes-master/FaceBoxes-master/faceboxes_deploy.prototxt";
String modelBinary = "D:/FaceBoxes-master/FaceBoxes-master/FaceBoxes_1024x1024.caffemodel";
dnn::Net net = readNetFromCaffe(modelConfiguration, modelBinary);
vector<String> layers = net.getLayerNames();
for (int i = 0; i < layers.size(); i++)
{
cout << layers[i] << endl;
}
Mat img = imread("D:/USERDATA/VUT58IL/Faces/Male/3.jpg");
resize(img, img, Size(1024, 1024), CV_INTER_CUBIC);
Mat inBlob = blobFromImage(img, 0.007843, Size(1024, 1024), Scalar::all(127.5), false, false);
net.setInput(inBlob, "data");
Mat out = net.forward("detection_out");
I am unable to find any solutions for this. Any help is greatly appreciated. Thank you!
@KlaimNod, If you can recompile OpenCV, comment a line
CV_Assert(!_aspectRatios.empty(), _minSize > 0);
at https://github.com/opencv/opencv/blob.... Then remove all theaspect_ratio: 1
from.prototxt
.@KlaimNod, There is also a bug in batch norm layer (where
use_global_stats
is set to false). We'll fix it and prior boxes generator in the future PR. Thank you!@dkurt, Thank you for the reply! Will try to recompile OpenCV but any rough estimate as to when the fix will be pushed?
@KlaimNod, you may track a progress at https://github.com/opencv/opencv/pull....
@KlaimNod @dkrut I'm still getting the same/similar error ... in the dnn class: try { layerSupportInPlace = l->getMemoryShapes(is, requiredOutputs, os, ints); }
Im trying to use https://github.com/zisianw/FaceBoxes.... with its pretrained model. To change the .prototxt file didnt help, I think i misunderstood you solution, can you gibe me a hint how to fix it? Thank you for your time