Skip to content
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

Fix draw to support new protobuf format #1884

Merged
merged 1 commit into from
Feb 17, 2015
Merged
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
16 changes: 8 additions & 8 deletions python/caffe/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def determine_edge_label_by_layertype(layer, layertype):
"""Define edge label based on layer type
"""

if layertype == 'DATA':
if layertype == 'Data':
edge_label = 'Batch ' + str(layer.data_param.batch_size)
elif layertype == 'CONVOLUTION':
elif layertype == 'Convolution':
edge_label = str(layer.convolution_param.num_output)
elif layertype == 'INNER_PRODUCT':
elif layertype == 'InnerProduct':
edge_label = str(layer.inner_product_param.num_output)
else:
edge_label = '""'
Expand All @@ -57,7 +57,7 @@ def determine_node_label_by_layertype(layer, layertype, rankdir):
# horizontal space is not; separate words with newlines
separator = '\n'

if layertype == 'CONVOLUTION':
if layertype == 'Convolution':
# Outer double quotes needed or else colon characters don't parse
# properly
node_label = '"%s%s(%s)%skernel size: %d%sstride: %d%spad: %d"' %\
Expand All @@ -70,7 +70,7 @@ def determine_node_label_by_layertype(layer, layertype, rankdir):
layer.convolution_param.stride,
separator,
layer.convolution_param.pad)
elif layertype == 'POOLING':
elif layertype == 'Pooling':
pooling_types_dict = get_pooling_types_dict()
node_label = '"%s%s(%s %s)%skernel size: %d%sstride: %d%spad: %d"' %\
(layer.name,
Expand All @@ -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':
elif layertype == 'Pooling':
color = '#FF9900'
elif layertype == 'INNER_PRODUCT':
elif layertype == 'InnerProduct':
color = '#CC33FF'
return color

Expand Down