speedinghzl / pytorch-segmentation-toolbox

PyTorch Implementations for DeeplabV3 and PSPNet
MIT License
772 stars 167 forks source link

boolean index did not match indexed array along dimension 0 #41

Open hhhwww123 opened 5 years ago

hhhwww123 commented 5 years ago

Hi, thank you for your work. I meet a problem when I run the evaluate.py. I change the input image size into (473,473) and raise the error:
500 images are loaded! 473 4730 processd Need 6 x 3 prediction tiles @ stride 316 px Predicting tile 1 evaluate.py:119: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead. padded_prediction = net(Variable(torch.from_numpy(padded_img), volatile=True).cuda()) Predicting tile 2 Predicting tile 3 Predicting tile 4 Predicting tile 5 Predicting tile 6 Predicting tile 7 Predicting tile 8 Predicting tile 9 Predicting tile 10 Predicting tile 11 Predicting tile 12 Predicting tile 13 Predicting tile 14 Predicting tile 15 Predicting tile 16 Predicting tile 17 Predicting tile 18 Traceback (most recent call last): File "evaluate.py", line 255, in main() File "evaluate.py", line 238, in main seg_pred = seg_pred[ignore_index] IndexError: boolean index did not match indexed array along dimension 0; dimension is 1024 but corresponding boolean dimension is 473

How can I solve this problem ???

ZOUWENMIN commented 3 years ago

have you solved your problem?