[IE CLDNN] Better error message when output is not found (#824)
authorVladimir Paramuzov <vladimir.paramuzov@intel.com>
Tue, 9 Jun 2020 09:26:28 +0000 (12:26 +0300)
committerGitHub <noreply@github.com>
Tue, 9 Jun 2020 09:26:28 +0000 (12:26 +0300)
inference-engine/src/cldnn_engine/cldnn_program.cpp

index 19abf81..5829900 100644 (file)
@@ -4910,6 +4910,12 @@ void Program::AddOutputPrimitive(cldnn::topology& topology, std::string outputNa
 
     // Find correct output ID. Start with name stored in IR.
     std::string outputID = outLayerName;
+    // This can happen when an output has invalid connections with previous layer and
+    // it's not handled by CreateSingleLayerPrimitive method
+    if (primitiveIDs.find(outLayerName) == primitiveIDs.end()) {
+        THROW_IE_EXCEPTION << "Can't find output with name " << outLayerName;
+    }
+
     std::string finalID = primitiveIDs.at(outLayerName);
 
     while (outputID != finalID) {