Solved by wxr5899 in post #10 
              
              
                This problem has been solved now! 
The bug is that when you zip or cycle image DataLoader, there might be a memory leakage! So, the memory of the CPU taken by training will be increasing with time going. 
The code is updated: 
def train_one_epoch_dg(model, optimizer, data_loaders, device, epoch, war…