Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix device of the tensors in set_nms #10574

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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