Solved by SarthakJain in post #2 
              
              
                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(…