Open yangfly opened 5 years ago
Hey, this is the MXNet Label Bot. Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it. Here are my recommended labels: Gluon, Feature
+1. I think it is necessary to support custom name for gluon block. For example, to implement a ResNet model, I would like to name the layers as the paper names. In addition, I have a pre-trained model for MXNet Symbol, and I need the consistent names of parameters to support Gluon Model.
I try to add name filed for gluon block. However, it is a little complicated.
You could try
gluon.nn.Conv2D(10, 3, prefix='conv1_')
@eureka7mt Thank you for your advice, but there are two drawbacks with prefix=name_
.
_fwd
_conv1
, _pool1
, _batchnorm1
, which is different from user defined names conv1
, pool1
and batchnorm1
。And why _fwd
is necessary in auto-naming?following, request +1
At present, the name of Gluon layer is automatically extended to
xxx/operator0_fwd
, based onname_scope
, which embodies modularization and avoids naming conflicts. However, the name field is not currently supported, resulting in a lack of flexibility.for example
Should Gluon layer also support custom name like
Symbol
. Internally, only layers without user definedname
are automatically named.This feature is useful in the following scenarios
Gluon
models can be aligned withSymbol
models or other framework, and users can specify more consistent naming method.Gluon
models can be compared more intuitively with the net structure in the papers withviz.print_summary
orviz.plot_network
.Symbol
model can be load more conveniently fromGluon
withload_parameters
.Welcome to this discussion!