I’ve been trying to use ConvTranspose2d with the following code.
upsample = nn.ConvTranspose2d(1024, 512, kernel_size=2)                                                                                                                              
e4=torch.randn(2, 512, 56, 56)                                                                                                                                                       
b=torch.randn(2, 1024, 28, 28)                                                                                                                                                       
b_1=upsample(b, output_size=e4.size())

It is giving the error
ValueError: requested an output size of torch.Size([56, 56]), but valid sizes range from [29, 29] to [29, 29] (for an input of torch.Size([28, 28]))
I am confused with this and not able to solve. Can anyone help me on this. Thanks in advance!!!