未验证 提交 00beb736 编写于 作者: J JYChen 提交者: GitHub

fix gather op out_of_range_error in Solov2 cpu inference (#4140)

上级 7092ea10
......@@ -488,6 +488,9 @@ class SOLOv2Head(nn.Layer):
fill_value=self.segm_strides[_ind],
dtype="int32"))
strides = paddle.concat(strides)
strides = paddle.concat(
[strides, paddle.zeros(
shape=[1], dtype='int32')])
strides = paddle.gather(strides, index=inds[:, 0])
# mask encoding.
......
......@@ -379,6 +379,9 @@ class SOLOv2Head(object):
dtype="float32",
value=self.segm_strides[_ind]))
strides = fluid.layers.concat(strides)
strides = fluid.layers.concat(
[strides, fluid.layers.zeros(
shape=[1], dtype='float32')])
strides = fluid.layers.gather(strides, index=inds[:, 0])
# mask encoding.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册