The loading of images onto RAM and GPU can be speed up through custom loaders but speeding the training through larger batch sizes is something different.
if you just want to speed up the load of images, have a look here on copying the data to GPU in parallel.

  
    
    
    How do I copy data to GPU in parallel? vision
  
  
    How about writing your own data loader in a separate thread? This can run in parrallel to your training loop. 
The data loading can look like this (I wrote the data caching in RAM but it can work for parrallel caching in GPU as well, i think): 
(cache_size is the number of images or data to be cached parrallelly) 
from threading import Thread
from time import sleep
import queue 
import time


trfqueue = queue.Queue(maxsize=20) 
tsfqueue = queue.Queue(maxsize=20) 

 
cache_size= 10
templist = []
…