This is the memory bar in Google Colab, so I think it is RAM but I’m not 100% sure. This happens independent on whether I use the CPU or GPU. The graph is completely from 1 epoch, at around 300 seconds the network has trained for about 120 batches. After 170 batches (400 seconds) all memory is used and Google Colab crashes. If it is helpful I could also show the code for my custom dataloader to see if that is causing the problem.