From a7e6a1059c3400c913e8de67d5abff2e2aa7e621 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sat, 29 Jan 2022 19:58:46 +0000 Subject: [PATCH] dnn(test): fix outputs handling in ONNX conformance - ONNX output is 1 tensor per defined output instead of N tensors from outputs of "output" layer --- modules/dnn/test/test_onnx_conformance.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/dnn/test/test_onnx_conformance.cpp b/modules/dnn/test/test_onnx_conformance.cpp index 71ac4bef19..0b146b3eb4 100644 --- a/modules/dnn/test/test_onnx_conformance.cpp +++ b/modules/dnn/test/test_onnx_conformance.cpp @@ -1171,10 +1171,10 @@ TEST_P(Test_ONNX_conformance, Layer_Test) } std::vector layerNames = net.getUnconnectedOutLayersNames(); - std::vector< std::vector > outputs_; + std::vector outputs; try { - net.forward(outputs_, layerNames); + net.forward(outputs, layerNames); } catch (...) { @@ -1182,8 +1182,7 @@ TEST_P(Test_ONNX_conformance, Layer_Test) applyTestTag(CV_TEST_TAG_DNN_ERROR_FORWARD); throw; } - ASSERT_GE(outputs_.size(), 1); - const std::vector& outputs = outputs_[0]; + ASSERT_GE(outputs.size(), 1); if (checkLayersFallbacks && checkFallbacks(net)) {