pytorch-segmentation-toolbox icon indicating copy to clipboard operation
pytorch-segmentation-toolbox copied to clipboard

boolean index did not match indexed array along dimension 0

Open hhhwww123 opened this issue 5 years ago • 1 comments

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 ???

hhhwww123 avatar Apr 04 '19 13:04 hhhwww123

have you solved your problem?

ZOUWENMIN avatar Sep 08 '21 02:09 ZOUWENMIN