Skip to content

Commit

Permalink
fix training in cascade_rcnn (PaddlePaddle#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrywgz authored Mar 19, 2021
1 parent 588d78b commit a2f57be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dygraph/ppdet/modeling/heads/cascade_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def _get_rois_from_boxes(self, boxes, im_shape):
clip_box = clip_bbox(boxes_per_image, im_shape[i])
if self.training:
keep = nonempty_bbox(clip_box)
if keep.shape[0] == 0:
keep = paddle.zeros([1], dtype='int32')
clip_box = paddle.gather(clip_box, keep)
rois.append(clip_box)
rois_num = paddle.concat([paddle.shape(r)[0] for r in rois])
Expand Down

0 comments on commit a2f57be

Please sign in to comment.