diff --git a/modules/dnn/src/layers/layers_common.cpp b/modules/dnn/src/layers/layers_common.cpp index f854d91ccc..bf5834c864 100644 --- a/modules/dnn/src/layers/layers_common.cpp +++ b/modules/dnn/src/layers/layers_common.cpp @@ -77,7 +77,20 @@ bool getParameter(const LayerParams ¶ms, const std::string& nameBase, const { if (params.has(nameAll_)) { - parameterH = parameterW = params.get(nameAll_); + DictValue param = params.get(nameAll_); + parameterH = param.get(0); + if (param.size() == 1) + { + parameterW = parameterH; + } + else if (param.size() == 2) + { + parameterW = param.get(1); + } + else + { + return false; + } return true; } else