diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2019-04-04 11:16:29 +0100 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2019-04-04 11:16:37 +0100 |
commit | bb190a6383df29883d77b95f34dbd6cf49a9d738 (patch) | |
tree | 49beb7b266a199a8a8612deb12a0ec3d8bcd67c3 | |
parent | 2fcce08c2afb7da9f18bd4d121e9ee9b0bec0ac2 (diff) | |
download | armnn-bb190a6383df29883d77b95f34dbd6cf49a9d738.tar.gz |
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 <francis.murtagh@arm.com>
-rwxr-xr-x | src/armnnTfParser/TfParser.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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<const tensorflow::NodeDef*> targetNodes; for (const std::string& requestedOutputName : m_RequestedOutputs) |