@JuanFMontesinos yes, you are right. thanks a lot. It fixed like this:
imgs = activations['up2']  
print(imgs.size()) #torch.Size([1, 128, 120, 160])
imgs = torch.nn.functional.interpolate(imgs, size=(240, 320), mode='bilinear')
print(imgs.size()) #torch.Size([1, 128, 240, 320])

how can I display the image after interpolation?
fig, axarr = plt.subplots(imgs.size(0))
for idx in range(imgs.size(0)):
       axarr[idx].imshow(imgs[idx].cpu().squeeze().numpy(), cmap = 'jet')
            
       plt.show()  
       save_results_to = 'D:/Neda/Pytorch/U-net/plots_U_Net/UNet_exp3_epoch/visulize_layers_epoch_100/new_plots/test_'         
       plt.savefig(save_results_to  + str(os.path.basename(flattened_im_paths[i])))
       plt.close("all")

not it doesn’t let to plot.  TypeError: 'AxesSubplot' object does not support indexing       how can I plot all of the 128 channels?