Try replacing these functions in the code below. I didn’t get the x_out = F.log_softmax(self.out(x_up5), 1) to work but I bet you got that one 
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.Upsample(scale_factor=2)
        self.conv_block = BaseConv(in_channels=in_channels+in_channels_skip, out_channels=out_channels, kernel_size=kernel_size, padding=padding, stride=stride)
        
    def forward(self, x, x_skip):
        x = torch.cat((x, x_skip), dim=1)
        x = self.conv_trans1(x)
        x = self.conv_block(x)
        return x


class UNet(nn.Module):
    def __init__(self, in_channels, out_channels, n_class, kernel_size, padding, stride):
        super(UNet, self).__init__()

        self.down1 = DownConv(in_channels, out_channels, kernel_size, padding, stride)

        self.down2 = DownConv(out_channels, out_channels, kernel_size, padding, stride)

        self.down3 = DownConv(out_channels, 2 * out_channels, kernel_size, padding, stride)

        self.down4 = DownConv(2 * out_channels, 4 * out_channels, kernel_size, padding, stride)
        
        self.down5 = DownConv(4 * out_channels, 4 * out_channels, kernel_size, padding, stride)
        
        
        self.down6 = BaseConv( 4 * out_channels, 4 * out_channels, kernel_size, padding, stride)
        

        self.up1 = UpConv(4 * out_channels, 4 * out_channels, 4 * out_channels, kernel_size, padding, stride)

        self.up2 = UpConv(4 * out_channels, 4 * out_channels, 4 * out_channels, kernel_size, padding, stride)
        
        self.up3 = UpConv(4 * out_channels, 2 * out_channels, 2 * out_channels, kernel_size, padding, stride)

        self.up4 = UpConv(2 * out_channels, out_channels, out_channels, kernel_size, padding, stride)

        self.up5 = UpConv(out_channels, out_channels, int(out_channels/2), kernel_size, padding, stride)
        
        self.out = nn.Conv2d(int(out_channels/2), n_class, kernel_size, padding, stride)