Hi,
I’m not aware at all about how TF records work. Have you think of using numpy mmap? if the images are same size you can create a big numpy array and read it on-demand and even make your own cache in ram.
Another option to optimize the process could be using nvidia dali https://developer.nvidia.com/DALI 8