diff --git a/fluid/PaddleCV/caffe2fluid/kaffe/paddle/network.py b/fluid/PaddleCV/caffe2fluid/kaffe/paddle/network.py index aa910797af66d79046e753b9039be4bffc6cc1ab..718bd196fa107b7adf20ff09d1ec192b090af8cd 100644 --- a/fluid/PaddleCV/caffe2fluid/kaffe/paddle/network.py +++ b/fluid/PaddleCV/caffe2fluid/kaffe/paddle/network.py @@ -440,7 +440,8 @@ class Network(object): if need_transpose: order = range(dims) - order.remove(axis).append(axis) + order.remove(axis) + order.append(axis) input = fluid.layers.transpose( input, perm=order, @@ -525,11 +526,21 @@ class Network(object): scale_shape = input.shape[axis:axis + num_axes] param_attr = fluid.ParamAttr(name=prefix + 'scale') scale_param = fluid.layers.create_parameter( - shape=scale_shape, dtype=input.dtype, name=name, attr=param_attr) + shape=scale_shape, + dtype=input.dtype, + name=name, + attr=param_attr, + is_bias=True, + default_initializer=fluid.initializer.Constant(value=1.0)) offset_attr = fluid.ParamAttr(name=prefix + 'offset') offset_param = fluid.layers.create_parameter( - shape=scale_shape, dtype=input.dtype, name=name, attr=offset_attr) + shape=scale_shape, + dtype=input.dtype, + name=name, + attr=offset_attr, + is_bias=True, + default_initializer=fluid.initializer.Constant(value=0.0)) output = fluid.layers.elementwise_mul( input,