@ptrblck thanks a lot for example. Before I make sure I understand this, I have two more questions. One is what
is the second in_channels in self.conv_trans1?
class UpConv(nn.Module):
    def __init__ (self, in_channels, in_channels_skip, out_channels, kernel_size, padding, stride):
        super(UpConv, self).__init__()
        self.conv_trans1 = nn.ConvTranspose2d(in_channels, in_channels, kernel_size=2, padding=0, stride=2)

and also why you did 2 * out_channels in self.down1 layer in UNet class?
sorry, I am asking a lot of question. I am follwoing your model before I go to debug mine.