未验证 提交 15b561d7 编写于 作者: Y Yang Zhang 提交者: GitHub

Update API usage according to 1.8 recommendations (#666)

上级 321f506d
......@@ -83,7 +83,7 @@ class TestRightPoolOp(unittest.TestCase):
place = fluid.CUDAPlace(0)
with fluid.program_guard(tp, sp):
x = fluid.layers.data(
x = fluid.data(
name=self.name,
shape=x_shape,
dtype=x_type,
......
......@@ -283,22 +283,14 @@ class FCOSHead(object):
last dimension is [x1, y1, x2, y2]
"""
act_shape_cls = self.__merge_hw(box_cls)
box_cls_ch_last = fluid.layers.reshape(
x=box_cls,
shape=[self.batch_size, self.num_classes, -1],
actual_shape=act_shape_cls)
box_cls_ch_last = fluid.layers.reshape(x=box_cls, shape=act_shape_cls)
box_cls_ch_last = fluid.layers.sigmoid(box_cls_ch_last)
act_shape_reg = self.__merge_hw(box_reg, "channel_last")
box_reg_ch_last = fluid.layers.transpose(box_reg, perm=[0, 2, 3, 1])
box_reg_ch_last = fluid.layers.reshape(
x=box_reg_ch_last,
shape=[self.batch_size, -1, 4],
actual_shape=act_shape_reg)
x=box_reg_ch_last, shape=act_shape_reg)
act_shape_ctn = self.__merge_hw(box_ctn)
box_ctn_ch_last = fluid.layers.reshape(
x=box_ctn,
shape=[self.batch_size, 1, -1],
actual_shape=act_shape_ctn)
box_ctn_ch_last = fluid.layers.reshape(x=box_ctn, shape=act_shape_ctn)
box_ctn_ch_last = fluid.layers.sigmoid(box_ctn_ch_last)
box_reg_decoding = fluid.layers.stack(
......
......@@ -162,7 +162,7 @@ class FCOS(object):
for i in range(len(self.fcos_head.fpn_stride)):
fields.extend(
['labels%d' % i, 'reg_target%d' % i, 'centerness%d' % i])
feed_vars = OrderedDict([(key, fluid.layers.data(
feed_vars = OrderedDict([(key, fluid.data(
name=key,
shape=inputs_def[key]['shape'],
dtype=inputs_def[key]['dtype'],
......
......@@ -152,5 +152,5 @@ class BFP(object):
out_shape = fluid.layers.cast(out_shape_, dtype='int32')
out_shape.stop_gradient = True
body_output = fluid.layers.resize_nearest(
body_input, scale=scale, actual_shape=out_shape)
body_input, scale=scale, out_shape=out_shape)
return body_output
......@@ -401,8 +401,7 @@ class CBResNet(object):
out_shape_ = shape_hw
out_shape = fluid.layers.cast(out_shape_, dtype='int32')
out_shape.stop_gradient = True
conv = fluid.layers.resize_nearest(
conv, scale=2., actual_shape=out_shape)
conv = fluid.layers.resize_nearest(conv, scale=2., out_shape=out_shape)
output = fluid.layers.elementwise_add(x=right, y=conv)
return output
......
......@@ -120,7 +120,7 @@ class HRFPN(object):
out_shape = fluid.layers.cast(out_shape_, dtype='int32')
out_shape.stop_gradient = True
body_output = fluid.layers.resize_bilinear(
body_input, scale=scale, actual_shape=out_shape)
body_input, scale=scale, out_shape=out_shape)
return body_output
def pooling(self, input, size, stride, pooling_type):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册