Open InstantWindy opened 5 years ago
I guess ,when detecting nothing, the mistake occurs
I have the same problem as yours....
I print the variables to debug, and find that
the value for gt_class_ids
is tensor([ 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=torch.int32, device='cuda:0')
,
and value for torch.nonzero(gt_class_ids < 0)
is tensor([], dtype=torch.int64, device='cuda:0')
Do you have any idea about how to avoid such situation?
I got it!
Change
if torch.nonzero(gt_class_ids < 0).size():
to
if torch.nonzero(gt_class_ids < 0).size() != (0,):
solves this problem.
I reviewed the other issues, and found that this bug has been discussed in detail in #24 ...
https://github.com/multimodallearning/pytorch-mask-rcnn/issues/33#issuecomment-419589620 this will solve the problem!!!!
Hi! when I run coco.py,it appears the error"IndexError: too many indices for tensor of dimension 1 ",I tried to output "gt_class_ids "value and found that its value is positive. Thanks.