Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Description
System information (version)
- OpenCV => 4.5.4
- Operating System / Platform => Ubuntu 18.04
- Compiler => gcc 7.5
Detailed description
Steps to reproduce
void opencv_verify(const std::string& model_name) { cv::dnn::Net net = cv::dnn::readNet(model_name); cv::Mat img = cv::Mat::zeros(192, 128, CV_8UC3); cv::Mat blob = cv::dnn::blobFromImage(img, 1.0 / 255.0, { 192, 128 }, {103.53, 116.28, 123.675}, true); net.setInput(blob, {std::string("input")}); std::vector<cv::Mat> detectionMat; net.forward(detectionMat, {std::string("output_w"),std::string("output_h")});// 6 845 1 W x H x C }It produces the following:
[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3553) getLayerShapesRecursively OPENCV/DNN: [Reshape]:(2296): getMemoryShapes() throws exception. inputs=1 outputs=1/1 blobs=0
[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3556) getLayerShapesRecursively input[0] = [ 1 15 -2147483648 48 ]
[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3560) getLayerShapesRecursively output[0] = [ ]
[ERROR:0] global /home/shaoqi.lsq/opencv/modules/dnn/src/dnn.cpp (3566) getLayerShapesRecursively Exception message: OpenCV(4.5.4-dev) /home/shaoqi.lsq/opencv/modules/dnn/src/layers/reshape_layer.cpp:106: error: (-215:Assertion failed) total(srcShape, srcRange.start, srcRange.end) == maskTotal in function 'computeShapeByReshapeMask'
I have checked the ONNXimport, the output blobs of reduce mean& reduce max layer's shape are right, i cannot figure out why it crashes during runtime and why -2147483648 appears in the shape.
The onnx model can be obtain here "http://alg-misc.cn-hangzhou.oss.aliyun-inc.com/person%2Fshaoqi.lsq%2Fhrnet_w32.onnx?Expires=1952593883&OSSAccessKeyId=Oo2cqQNkidSaUBIN&Signature=lgLPwpMtEjJkkgG%2BGSkDFrk1dSo%3D"