未验证 提交 53da1d39 编写于 作者: L Leo Chen 提交者: GitHub

remove name in ParamAttr, test=develop (#4228)

上级 ca37af64
......@@ -40,7 +40,7 @@ class conv2d(fluid.dygraph.Layer):
if use_bias == False:
con_bias_attr = False
else:
con_bias_attr = fluid.ParamAttr(name="conv_bias",initializer=fluid.initializer.Constant(0.0))
con_bias_attr = fluid.ParamAttr(initializer=fluid.initializer.Constant(0.0))
self.conv = Conv2D(
num_channels=num_channels,
......@@ -50,17 +50,14 @@ class conv2d(fluid.dygraph.Layer):
padding=padding,
use_cudnn=use_cudnn,
param_attr=fluid.ParamAttr(
name="conv2d_weights",
initializer=fluid.initializer.NormalInitializer(loc=0.0,scale=stddev)),
bias_attr=con_bias_attr)
if norm:
self.bn = BatchNorm(
num_channels=num_filters,
param_attr=fluid.ParamAttr(
name="scale",
initializer=fluid.initializer.NormalInitializer(1.0,0.02)),
bias_attr=fluid.ParamAttr(
name="bias",
initializer=fluid.initializer.Constant(0.0)),
trainable_statistics=True
)
......@@ -99,7 +96,7 @@ class DeConv2D(fluid.dygraph.Layer):
if use_bias == False:
de_bias_attr = False
else:
de_bias_attr = fluid.ParamAttr(name="de_bias",initializer=fluid.initializer.Constant(0.0))
de_bias_attr = fluid.ParamAttr(initializer=fluid.initializer.Constant(0.0))
self._deconv = Conv2DTranspose(num_channels,
num_filters,
......@@ -107,7 +104,6 @@ class DeConv2D(fluid.dygraph.Layer):
stride=stride,
padding=padding,
param_attr=fluid.ParamAttr(
name="this_is_deconv_weights",
initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=stddev)),
bias_attr=de_bias_attr)
......@@ -117,9 +113,8 @@ class DeConv2D(fluid.dygraph.Layer):
self.bn = BatchNorm(
num_channels=num_filters,
param_attr=fluid.ParamAttr(
name="de_wights",
initializer=fluid.initializer.NormalInitializer(1.0, 0.02)),
bias_attr=fluid.ParamAttr(name="de_bn_bias",initializer=fluid.initializer.Constant(0.0)),
bias_attr=fluid.ParamAttr(initializer=fluid.initializer.Constant(0.0)),
trainable_statistics=True)
self.outpadding = outpadding
self.relufactor = relufactor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册