Don’t use image_loader function. Use pytorch torch.utils.data.DataLoader which is the standard for loading data in pytorch. And Variable is deprecated.
Refer to the pytorch data loading tutorial link 5