bigmb / Unet-Segmentation-Pytorch-Nest-of-Unets

Implementation of different kinds of Unet Models for Image Segmentation - Unet , RCNN-Unet, Attention Unet, RCNN-Attention Unet, Nested Unet
MIT License
1.87k stars 345 forks source link

May have future issues in input size in basic Unet #52

Closed Andrew-Ma-2001 closed 2 years ago

Andrew-Ma-2001 commented 2 years ago

Hi, when I was implementing the pytorch model in the class U_net, I found that with some values of input size (for example 700x700), there could be a problem inside

d5 = torch.cat((e4, d5), dim=1)

where e4 and d5 may not be the same size, instead they will be different only with one. I guess is with the up conv that in some covs the calculate of size is using int(), some are larger than .5 so it increase 1.

bigmb commented 2 years ago

Thanks for clarifying for others about this issue. It's because when you go deep in the network, it tries to divide in multiples of 2. So if you go 4 layers deep, that has to be divisible by 16.