In a way, I am trying to visualize the output of CONV5-3 layer in VGG 16 by up-sampling it. My target is of size [360x640], where 8 in [8x360x640] represents the batch size.
The model that I have built using VGG 16 looks like this.

class net(nn.Module):
def init(self):
super(net,self).init()
    vgg16 = models.vgg16(pretrained=True)
    
    encoder = list(vgg16.features.children())[:-1]
    self.encoder = nn.Sequential(*encoder)
    #for param in encoder.parameters():
        #param.requires_grad = False
    self.decoder = nn.Conv2d(512,1,1,padding=0,bias=False)
def forward(self,x):
    e_x = self.encoder(x)
    d_x = self.decoder(e_x)
    d_x = nn.functional.interpolate(d_x,size=(480,640),mode='bilinear',align_corners=False)
    d_x = d_x.squeeze(1)
    mi = t.min(d_x.view(-1,480*640),1)[0].view(-1,1,1)
    ma = t.max(d_x.view(-1,480*640),1)[0].view(-1,1,1)
    n_x = (d_x-mi)/(ma-mi)
    return e_x,n_x