So you can use ImageFolder for data loader. Check this. You also need to set shuffle=False if the sequence is important. Or you can use general dataloader class like this. in the __getitem__ method you need to load images, process them and return them and in the training loop feed them into the model.