Fix output name collision for incorrect ONNX models (#1930)

This commit is contained in:
Maxim Vafin 2020-08-25 18:43:43 +03:00 committed by GitHub
parent 7b79db8cc8
commit b9f698b456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,9 @@ def protobuf2nx(graph, pb):
for outp in pb.graph.output:
name = str(outp.name)
if graph.has_node(name):
raise Error('Name {} of output node already exists in graph.', name)
log.error('Name {} of output node already exists in graph. Ignoring this output. If the output is required,'
' please rename it.'.format(name), extra={'is_warning': True})
continue
else:
# add fake node on output
graph.add_node(name, kind='op', op='FakeOutput', pb=outp)