Well there seems to be some overhead by using the Dataset + Dataloader classes. Create a TensorDataset 53 (or some other datastructure) outside of your training loop without the use of the Dataset + Dataloader classes. Then you can come up with your own indexes (randomly) and simply get the relevant items from your datastructure. This way you load into RAM and don’t have to deal with the dataloader overhead each epoch