You have to change your transforms to transforms.Compose([transforms.ToTensor()]) since currently you only have a class object, but not an instance and calling a class object will result in creating an instance, but you already need a callable instance here.