Hi
I am reading an image using both matplotlib imread and imagefolder dataloader.
When plotting the output looks okay for imread but the one with imagefolder output is multiplied to 9 for one image though the shape looks okay (9 of the same images with different channels I suppose as its not color anymore).
while plt.imread(img_path) will give you an image of shape [H, W, C]
If you want the image tensor you get from your datalaoder to be of the same shape, then you have to use .permute(1, 2, 0) on your tensor.
On your example this could be done here:
plt.imshow(images[0].permute(1, 2, 0))
Please also keep in mind that .ToTensor() puts your image data into the range [0, 1] by dividing by 255