fcjian / TOOD

TOOD: Task-aligned One-stage Object Detection, ICCV2021 Oral

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError

liuzt1024 opened this issue · comments

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:2 and cuda:0!

We didn't encounter the similar problem, can you provide more information about this RuntimeError?

after this function:tood_head.py
losses_cls, losses_bbox,
cls_avg_factors, bbox_avg_factors = multi_apply(self.loss_single)
print(f'bbox_avg_factors : {bbox_avg_factors}')
get result:
bbox_avg_factors : [tensor(49.6258, device='cuda:3'), tensor(14.4483, device='cuda:3'), tensor(0, device='cuda:0'), tensor(0, device='cuda:0'), tensor(0, device='cuda:0')]

I use gpu3 for training
cls_avg_factors : [tensor(0., device='cuda:3'), tensor(0., device='cuda:3'), tensor(9., device='cuda:3'), tensor(9., device='cuda:3'), tensor(0., device='cuda:3')]
bbox_avg_factors : [tensor(0, device='cuda:0'), tensor(0, device='cuda:0'), tensor(6.4019, device='cuda:3'), tensor(6.3117, device='cuda:3'), tensor(0, device='cuda:0')]