From eb901866147707d12a90479b489bd26667e4c3c4 Mon Sep 17 00:00:00 2001 From: Anastasia M Date: Wed, 17 Feb 2021 21:01:41 +0300 Subject: [PATCH] Merge pull request #19417 from LupusSanctus:am/text_graph_identity * Corrected SSD text graph generation for Identity nodes * Added minor code corrections --- samples/dnn/tf_text_graph_common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/dnn/tf_text_graph_common.py b/samples/dnn/tf_text_graph_common.py index ea24898873..c82053b4fb 100644 --- a/samples/dnn/tf_text_graph_common.py +++ b/samples/dnn/tf_text_graph_common.py @@ -270,7 +270,11 @@ def removeIdentity(graph_def): identities = {} for node in graph_def.node: if node.op == 'Identity' or node.op == 'IdentityN': - identities[node.name] = node.input[0] + inp = node.input[0] + if inp in identities: + identities[node.name] = identities[inp] + else: + identities[node.name] = inp graph_def.node.remove(node) for node in graph_def.node: