Hi,
You are setting transforms into batch_size. DataLoader does not accept transforms, you need to apply it on Dataset.



 alameer:

dataset = DataLoader(data_dir, transforms.Compose([transforms.ToTensor()]))


dataset = ImageFolderWithPaths(data_dir, transform=transforms.Compose([transforms.ToTensor()]))
dataloader = DataLoader(dataset, batch_size=16)

Or I think you mistyped Dataloader with ImageFolderWithPaths in the last line. As a  Dataloader does not accept a data direction or transform which on the otherside, your custom dataset does.
Official tutorial 7
Bests