this is not working. Image.fromarray needs a single image, and not the dataset. Also, if I follow your code, the transformation is the same for every epoch. It’s also not how it’s used in the tutorial (https://pytorch.org/tutorials/beginner/data_loading_tutorial.html 14, compare the FaceLandmarksDataset and it’s __getitem__ method).
So, is there a generic numpy dataset? It seems trivial to build, but I can’t really believe that it’s not per default in torchvision.