Usually you don’t need to load your complete dataset into the memory.
Using a DataLoader you will get mini batches containing several samples which are used for training.
Have a look at the Data loading tutorial 1.3k for an introduction.