Merge pull request #18353 from l-bat:issue_18350

* Fixed bug in ONNX Mul op

* Replaced node
pull/18362/head
Liubov Batanina 4 years ago committed by GitHub
parent e668cff573
commit ebb528976f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      modules/dnn/src/onnx/onnx_importer.cpp
  2. 7
      modules/dnn/test/test_onnx_importer.cpp

@ -1051,6 +1051,16 @@ void ONNXImporter::populateNet(Net dstNet)
}
else
{
// Scale layer allocate output with the first input shape
if (total(outShapes[node_proto.input(0)]) < total(outShapes[node_proto.input(1)]))
{
opencv_onnx::NodeProto proto;
proto.add_input(node_proto.input(1));
proto.add_input(node_proto.input(0));
proto.add_output(layerParams.name);
node_proto = proto;
}
if (isDiv)
{
LayerParams powerParams;

@ -267,6 +267,13 @@ TEST_P(Test_ONNX_layers, ReduceMaxGlobal)
testONNXModels("reduce_max");
}
TEST_P(Test_ONNX_layers, Scale)
{
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
testONNXModels("scale");
}
TEST_P(Test_ONNX_layers, ReduceMean3D)
{
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 && target != DNN_TARGET_CPU)

Loading…
Cancel
Save