feature map size after upsample is 2h or 2(h+1)?
Lucksong opened this issue · comments
Lucksong commented
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 commented
So,2*(h+1) is right? Shouldn`t it be 2*h?
Wenqi Tang commented
Hi, Has your question been solved? @Lucksong
I also want to know why it not be 2*Hin
but 2*(Hin+1)
.
tengjunvan commented
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.