Solved by ptrblck in post #2 
              
              
                Since ImageFolder will lazily load the data in its __getitem__ method, you could create three different dataset instances for training, validation, and test and could pass the appropriate transformation to them. 
You could then create the sample indices via torch.arange(nb_samples) (or the numpy equ…