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
pull/21540/head
Alexander Alekhin 3 years ago
parent 85719a0a5d
commit a7e6a1059c
  1. 7
      modules/dnn/test/test_onnx_conformance.cpp

@ -1171,10 +1171,10 @@ TEST_P(Test_ONNX_conformance, Layer_Test)
} }
std::vector<String> layerNames = net.getUnconnectedOutLayersNames(); std::vector<String> layerNames = net.getUnconnectedOutLayersNames();
std::vector< std::vector<Mat> > outputs_; std::vector<Mat> outputs;
try try
{ {
net.forward(outputs_, layerNames); net.forward(outputs, layerNames);
} }
catch (...) catch (...)
{ {
@ -1182,8 +1182,7 @@ TEST_P(Test_ONNX_conformance, Layer_Test)
applyTestTag(CV_TEST_TAG_DNN_ERROR_FORWARD); applyTestTag(CV_TEST_TAG_DNN_ERROR_FORWARD);
throw; throw;
} }
ASSERT_GE(outputs_.size(), 1); ASSERT_GE(outputs.size(), 1);
const std::vector<Mat>& outputs = outputs_[0];
if (checkLayersFallbacks && checkFallbacks(net)) if (checkLayersFallbacks && checkFallbacks(net))
{ {

Loading…
Cancel
Save