class model(nn.Module):
    def __init__(self, in_channel, num_channel, out_class):
        super(QuickNAT, self).__init__()
        self.in_channel = in_channel
        self.num_channel = num_channel
        self.out_class = out_class
        self.encoder = Encoder(self.in_channel, self.num_channel)
        
    def forward(self,x):
        x5, x4, x3, x2, x1, idx1, idx2, idx3, idx4 = self.encoder(x)
        decoder = Decoder(self.num_channel, self.out_class, idx1, idx2, idx3, idx4, x4,x3,x2,x1)
        decoder = decoder.to(device)
        x = decoder(x5)
        return x

Change to this, the error fixed