We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2f7fc59 + 09130ce commit 6f5f7c5Copy full SHA for 6f5f7c5
1 file changed
python/caffe/net_spec.py
@@ -32,7 +32,7 @@ def param_name_dict():
32
# get all parameter names (typically underscore case) and corresponding
33
# type names (typically camel case), which contain the layer names
34
# (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')]
+ param_names = [f.name for f in layer.DESCRIPTOR.fields if f.name.endswith('_param')]
36
param_type_names = [type(getattr(layer, s)).__name__ for s in param_names]
37
# strip the final '_param' or 'Parameter'
38
param_names = [s[:-len('_param')] for s in param_names]
0 commit comments