Skip to content

Commit 6f5f7c5

Browse files
committed
Merge pull request #3977 from tpwrules/master
Fix protobuf message generation
2 parents 2f7fc59 + 09130ce commit 6f5f7c5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/caffe/net_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def param_name_dict():
3232
# get all parameter names (typically underscore case) and corresponding
3333
# type names (typically camel case), which contain the layer names
3434
# (note that not all parameters correspond to layers, but we'll ignore that)
35-
param_names = [s for s in dir(layer) if s.endswith('_param')]
35+
param_names = [f.name for f in layer.DESCRIPTOR.fields if f.name.endswith('_param')]
3636
param_type_names = [type(getattr(layer, s)).__name__ for s in param_names]
3737
# strip the final '_param' or 'Parameter'
3838
param_names = [s[:-len('_param')] for s in param_names]

0 commit comments

Comments
 (0)