You could preload all images and store them in a large tensor, if you have enough RAM and are OK with spending the loading time during initialization.
However, once you are dealing with image tensors, note that you won’t be able to use a lot of torchvision.transforms anymore, as they are using PIL.Images.
If you are using a DataLoader to load each sample separately, you could lazily load the data using multiple workers in the background, while the GPU is busy with the model training, thus hiding the data loading.