From 2638c5e9b7121e16c0108876dee7bdd9cc086924 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 16 Jan 2020 14:31:43 +0300 Subject: [PATCH] dnn: dump layer's blobs on getMemoryShapes() error --- modules/dnn/src/dnn.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index ccd603e..719b0af 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -2839,7 +2839,9 @@ struct Net::Impl catch (const cv::Exception& e) { CV_LOG_ERROR(NULL, "OPENCV/DNN: [" << l->type << "]:(" << l->name << "): getMemoryShapes() throws exception." << - " inputs=" << is.size() << " outputs=" << os.size() << "/" << requiredOutputs); + " inputs=" << is.size() << + " outputs=" << os.size() << "/" << requiredOutputs << + " blobs=" << l->blobs.size()); for (size_t i = 0; i < is.size(); ++i) { CV_LOG_ERROR(NULL, " input[" << i << "] = " << toString(is[i])); @@ -2848,6 +2850,10 @@ struct Net::Impl { CV_LOG_ERROR(NULL, " output[" << i << "] = " << toString(os[i])); } + for (size_t i = 0; i < l->blobs.size(); ++i) + { + CV_LOG_ERROR(NULL, " blobs[" << i << "] = " << typeToString(l->blobs[i].type()) << " " << toString(shape(l->blobs[i]))); + } CV_LOG_ERROR(NULL, "Exception message: " << e.what()); throw; } -- 2.7.4