aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfParser/TfParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnnTfParser/TfParser.cpp')
-rwxr-xr-xsrc/armnnTfParser/TfParser.cpp16
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)