I get this error: Invalid shape (120, 120, 1) for image data
I am sending a grayscale image with this transformation
transforms.Grayscale(num_output_channels=1)

but in the code I get the error:
plt.imshow(np.transpose(im_inv.numpy(), (1, 2, 0)))