speedinghzl / pytorch-segmentation-toolbox

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

bug, using sliding eval with batch size larger than 1 on each gpu #57

Open fuchangjie opened 4 years ago

fuchangjie commented 4 years ago

evaluate.py in branch pytorch-1.1 line 134 and line 135 you only use the prediction result of the first image, but treat it as the result of the remaining images in the same batch, in line 136. so something goes wrong when evaluate with batch size larger than 1. you should modify it with prediction = padded_prediction[:, 0:img.shape[2], 0:img.shape[3], :] and count_predictions[:, y1:y2, x1:x2] += 1

ybchen97 commented 3 years ago

@fuchangjie Hey, thank you so much for finding this bug!

ironcadiz commented 3 years ago

I wrote #55 like a year ago addressing this