Creating custom dataset class to do data augmentation on numpy arrays - getting an error

For the first error looks like your data is already a PIL image, so ToPILImage fails.

For the second error you forgot parenthesis. Instead of transforms.RandomHorizontalFlip, transforms.RandomVerticalFlip try using transforms.RandomHorizontalFlip(), transforms.RandomVerticalFlip()

1 Like