pytorch-fcn icon indicating copy to clipboard operation
pytorch-fcn copied to clipboard

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

Open Lucksong opened this issue 5 years ago • 3 comments

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 2*Hin

Lucksong avatar Oct 12 '19 08:10 Lucksong

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

Lucksong avatar Oct 13 '19 12:10 Lucksong

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

super233 avatar Feb 09 '20 07:02 super233

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.

tengjunvan avatar Mar 26 '20 07:03 tengjunvan