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>
diff --git a/src/armnnTfParser/TfParser.cpp b/src/armnnTfParser/TfParser.cpp
index 8e57e56..028a932 100755
--- a/src/armnnTfParser/TfParser.cpp
+++ b/src/armnnTfParser/TfParser.cpp
@@ -3251,6 +3251,22 @@
         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)