8000 Adapt python net drawing to new proto format by axel-angel · Pull Request #1984 · BVLC/caffe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adapt python net drawing to new proto format #1984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions python/caffe/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ def choose_color_by_layertype(layertype):
"""Define colors for nodes based on the layer type
"""
color = '#6495ED' # Default
if layertype == 'Convolution':
if layertype == 'CONVOLUTION':
color = '#FF5050'
elif layertype == 'Pooling':
75B6 elif layertype == 'POOLING':
color = '#FF9900'
elif layertype == 'InnerProduct':
elif layertype == 'INNER_PRODUCT':
color = '#CC33FF'
return color

Expand All @@ -105,9 +105,10 @@ def get_pydot_graph(caffe_net, rankdir, label_edges=True):
pydot_graph = pydot.Dot(caffe_net.name, graph_type='digraph', rankdir=rankdir)
pydot_nodes = {}
pydot_edges = []
for layer in caffe_net.layer:
for layer in caffe_net.layers:
name = layer.name
layertype = layer.type
layertype_num = layer.type
layertype = layer.LayerType.DESCRIPTOR.values_by_number[layertype_num].name
node_label = determine_node_label_by_layertype(layer, layertype, rankdir)
if (len(layer.bottom) == 1 and len(layer.top) == 1 and
layer.bottom[0] == layer.top[0]):
Expand Down
0