Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
print repetead node names
Browse files Browse the repository at this point in the history
  • Loading branch information
roywei committed Apr 12, 2018
1 parent 8859bac commit 73000eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/mxnet/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,13 @@ def plot_network(symbol, title="plot", save_format='pdf', shape=None, node_attrs
nodes = conf["nodes"]
# check if multiple nodes have the same name
if len(nodes) != len(set([node["name"] for node in nodes])):
seen = set()
seen_add = seen.add
# find all repeated names
repeated = set(node['name'] for node in nodes if node['name'] in seen
or seen_add(node['name']))
logging.warning("There are multiple variables with the same name in your graph, "
"this may result in cyclic graph")
"this may result in cyclic graph. Repeated names: %s", ','.join(repeated))
# default attributes of node
node_attr = {"shape": "box", "fixedsize": "true",
"width": "1.3", "height": "0.8034", "style": "filled"}
Expand Down

0 comments on commit 73000eb

Please sign in to comment.