diff --git a/ppdet/modeling/heads/solov2_head.py b/ppdet/modeling/heads/solov2_head.py index 6af68bf6166da577afb2f4e8c690e772d6055e15..355d57e649b0c231e09e8da231021de4695e3a96 100644 --- a/ppdet/modeling/heads/solov2_head.py +++ b/ppdet/modeling/heads/solov2_head.py @@ -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. diff --git a/static/ppdet/modeling/anchor_heads/solov2_head.py b/static/ppdet/modeling/anchor_heads/solov2_head.py index 990a18c9a2bea3b5aaa2aea0a2c0df40ae2b798e..74a681f01c462bc944ba8dff8868a36ab12b4a3b 100644 --- a/static/ppdet/modeling/anchor_heads/solov2_head.py +++ b/static/ppdet/modeling/anchor_heads/solov2_head.py @@ -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.