From bb190a6383df29883d77b95f34dbd6cf49a9d738 Mon Sep 17 00:00:00 2001 From: Francis Murtagh Date: Thu, 4 Apr 2019 11:16:29 +0100 Subject: IVGCVSW-2539 Improve ExecuteNetwork error logging * Add check to ensure requested input node exists otherwise give coherent error message Change-Id: Ifee5f1d459f989c2e808cf78806f9a9a7f7c763f Signed-off-by: Francis Murtagh --- src/armnnTfParser/TfParser.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/armnnTfParser') diff --git a/src/armnnTfParser/TfParser.cpp b/src/armnnTfParser/TfParser.cpp index 8e57e56917..028a932b42 100755 --- a/src/armnnTfParser/TfParser.cpp +++ b/src/armnnTfParser/TfParser.cpp @@ -3251,6 +3251,22 @@ void TfParser::LoadGraphDef(const tensorflow::GraphDef& graphDef) m_NodesByName[node.name()] = &node; } + // Checks that the input nodes the user has requested exist. + for (const auto& pair : m_InputShapes) + { + const std::string& requestedInputName = pair.first; + auto nodeIt = m_NodesByName.find(requestedInputName); + if (nodeIt == m_NodesByName.end()) + { + throw ParseException( + boost::str( + boost::format( + "Couldn't find requested input node '%1%' in graph %2%") + % requestedInputName + % CHECK_LOCATION().AsString())); + } + } + // Finds the output nodes the user requested. std::vector targetNodes; for (const std::string& requestedOutputName : m_RequestedOutputs) -- cgit v1.2.1