Hi,
To answer your question: (I found the type of img1 seemed turned to be class ‘torch.Tensor’ rather than normal class ‘PIL.Image.Image’ like img2)
Since you don’t call much operations in the call part of your class then I would suggest checking the types of your train loader.
You can run next(iter(train_loader)) and then recieve all the data to which you can find the type. Since your call function does nothing to im1 to convert it to a Tensor then I suggest checking your getitem function in your data loader or your collate_fn if you pass one to the data loader as that could also possiblt convert im1 to a Tensor before it is being called by Compose().
Sarthak