Skip to content

Commit

Permalink
Fix device of the tensors in set_nms (#10574)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-unfinity committed Jul 21, 2023
1 parent 00c5586 commit 3edcc16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mmdet/models/roi_heads/bbox_heads/multi_instance_bbox_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ def set_nms(bboxes: Tensor,

keep = torch.ones(len(ordered_bboxes)) == 1
ruler = torch.arange(len(ordered_bboxes))

keep = keep.to(bboxes.device)
ruler = ruler.to(bboxes.device)

while ruler.shape[0] > 0:
basement = ruler[0]
ruler = ruler[1:]
Expand Down

0 comments on commit 3edcc16

Please sign in to comment.