Train on big dataset (1mil + images)
is your data stored in raw ASCII text, like a CSV file?

Perhaps you can speed up data loading and use less memory by using another data format. A good example is a binary format like GRIB, NetCDF, or HDF.

There are many command line tools that you can use to transform one data format into another that do not require the entire dataset to be loaded into memory.

Using another format may allow you to store the data in a more compact form that saves memory, such as 2-byte integers, or 4-byte floats.

In some cases, you may need to resort to a big data platform.
That is, a platform designed for handling very large datasets, that allows you to use data transforms and machine learning algorithms on top of it.