Hi,
The imagenet example 488 should give you some ideas.
In your case I would say use the builtin dataloader with enough cpu processes to load images fast enough to feed your GPU.
Note that if your CPU is not good enough, you can take a look at Nvidia’s DALI 97 library to do the decoding on gpu which will free up the CPU quite a lot.