You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: invalid argument 1: cannot perform reduction function min on tensor with no elements because the operation does not have an identity at /root/pytorch/aten/src/THH/generic/THHTensorMathReduce.hip:65
#502
Open
rraminen opened this issue
Apr 19, 2020
· 0 comments
Reason:
This occurs when clas_tgt is tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], device='cuda:0') .
Then torch.nonzero(clas_tgt-self.pad_idx) becomes tensor([], device='cuda:0', size=(0, 1), dtype=torch.int64).
As torch.nonzero(clas_tgt-self.pad_idx) is an empty tensor, applying torch.min() on an empty tensor throws this error.
The text was updated successfully, but these errors were encountered:
In pascal.ipynb, the below error occurs
def _unpad(self, bbox_tgt, clas_tgt):
---> i = torch.min(torch.nonzero(clas_tgt-self.pad_idx))
return tlbr2cthw(bbox_tgt[i:]), clas_tgt[i:]-1+self.pad_idx
Reason:
This occurs when clas_tgt is tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], device='cuda:0') .
Then torch.nonzero(clas_tgt-self.pad_idx) becomes tensor([], device='cuda:0', size=(0, 1), dtype=torch.int64).
As torch.nonzero(clas_tgt-self.pad_idx) is an empty tensor, applying torch.min() on an empty tensor throws this error.
The text was updated successfully, but these errors were encountered: