wkentaro / pytorch-fcn

PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)
MIT License
1.74k stars 480 forks source link

feature map size after upsample is 2h or 2(h+1)? #141

Open Lucksong opened 4 years ago

Lucksong commented 4 years ago

As your code 'self.upscore2 = nn.ConvTranspose2d( n_class, n_class, 4, stride=2, bias=False)' for example. According to the deconvolution formula described in the pytorch documentation: Hout=(Hin−1)∗stride[0]−2∗padding[0]+kernel_size[0]+output_padding[0]

Hout should be 2(Hin+1) not 2Hin

Lucksong commented 4 years ago

So,2(h+1) is right? Shouldn`t it be 2h?

super233 commented 4 years ago

Hi, Has your question been solved? @Lucksong I also want to know why it not be 2*Hin but 2*(Hin+1).

tengjunvan commented 4 years ago

I'm confused as well. I think there is something to do with the input data because I notice a slice operation of "h" in forward.