multimodallearning / pytorch-mask-rcnn

Other
2.01k stars 557 forks source link

potential bugs in model.py #64

Open jbitton opened 5 years ago

jbitton commented 5 years ago

I'm trying to train a mask-rcnn using my own dataset. I've been running into several issues with if statements like these:

if torch.nonzero(gt_class_ids < 0).size():

Essentially, this kind of if statement will always return True even if the size is actually equal to 0. The reason why is because size() returns a torch.Size object. However, if I change the if statement to be:

if torch.nonzero(gt_class_ids < 0).size()[0]:

then everything seems to work fine. There are multiple occurrences of this found within model.py. I'm using python-3.6, cuda-9.0, and pytorch-0.4.0. I know that others must've been able to use the code successfully, so I'm wondering: are these issues I've found legit, or is something else wrong (either with my dataset, python versioning, etc etc)?

Thank you in advance.

mrzw commented 5 years ago

please see here