(1) Have an explicit loop that fits mini batches. Each time a batch is read off disk.
(2) Create some sort of file handle object for keras that does not explicitly read the data, but only allows the data to be read in chunks. Search keras for an API.
Note that it is possible to convert themrc files to numpy arrays and write them to disk in a big chunk to speed things up.
I see two ways to avoid swamping the memory
(1) Have an explicit loop that fits mini batches. Each time a batch is read off disk.
(2) Create some sort of file handle object for keras that does not explicitly read the data, but only allows the data to be read in chunks. Search keras for an API.
Note that it is possible to convert the
mrc
files tonumpy
arrays and write them to disk in a big chunk to speed things up.