Solved by viraat in post #2 
              
              
                For this you would have to create/modify a data loader class. 
You can have a look at this tutorial - Data Loading and Processing Tutorial 
I’ve modified the code from the tutorial to reflect something like you have asked below 
class ImageDataset(Dataset):

    def __init__(self, csv_file, root_dir…