Confused by <transform.ToTensor()> output

Hello,
I am a quite confused by the behavior of transforms.ToTensor()'s output.
I am trying to visualize the output of the transform right before it is fed into the model and I see tilled output. The .ToTensor() is returning a tilled image after the transform. I manually transform the image and plotted the output. This is showing up different than than the output from ToTensor() transform. I have attached images of code with comments to illustrate the issue. Appreciate any info into the matter. :slight_smile:
Thank you for you time and consideration. Screen Shot 2021-03-12 at 7.07.07 AM|509x500

Follow on from above:
This image shows the output of the manual scaling matches that of .ToTensor(). However the plots are different.

Instead of doing .view you could try

tensor_image.permute(1,2,0)

sometimes .view can mess up the image.

1 Like

That helped. Thanks! @Dwight_Foster :pray: :slight_smile:

1 Like