Hi Kshitij!



 kshitijpatil09:

I’ve two tensors namely pred_boxes and gt_boxes and both are on the ‘cuda’.


Please double check this.  I can’t reproduce this (on an older version
of pytorch).


So I tried calling the torch.max for the bounding box tensors to verify the same
torch.max(gt_boxes[:, None, :2], pred_boxes[:, :2])

Which indeed is causing this issue
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-42-2742a63bf57b> in <module>
----> 1 torch.max(gt_boxes[:, None, :2], pred_boxes[:, :2])

RuntimeError: expected device cpu but got device cuda:0



Could you add
print (torch.max)   # to make sure you didn't overwrite torch.max
print (gt_boxes.device, pred_boxes.device)   # verify tensor locations

before your call to torch.max()?
Best.
K. Frank