Displaying RGB and LAB images

I am trying to display an RGB image using imshow, but it does not let me display it and gives the error - “Invalid dimensions for image data”.
The dimensions of the image variable that I am trying to display are 33232.

matplotlib usually expects the images to have the channel in dim2, so try to permute your image tensor using tensor = tensor.permute(1, 2, 0) before passing it to imshow.