Solved by Shani_Gamrian in post #4 
              
              
                You need to wrap the data with transforms.Compose before you return it. 
For example add to the __init__: 
self.transform = transforms.Compose([transforms.ToTensor()])  # you can add to the list all the transformations you need. 

and in __getitem__ do: 
return self.transform(self.x_data[index]), se…