Skip to content

Commit eb90186

Browse files
author
Anastasia M
authored
Merge pull request opencv#19417 from LupusSanctus:am/text_graph_identity
* Corrected SSD text graph generation for Identity nodes * Added minor code corrections
1 parent 8d21c84 commit eb90186

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

samples/dnn/tf_text_graph_common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ def removeIdentity(graph_def):
270270
identities = {}
271271
for node in graph_def.node:
272272
if node.op == 'Identity' or node.op == 'IdentityN':
273-
identities[node.name] = node.input[0]
273+
inp = node.input[0]
274+
if inp in identities:
275+
identities[node.name] = identities[inp]
276+
else:
277+
identities[node.name] = inp
274278
graph_def.node.remove(node)
275279

276280
for node in graph_def.node:

0 commit comments

Comments
 (0)