It’s hard to say without looking at the rest of the code - but maybe try reduce the batch size? Maybe even try reduce the size of your dataset?
Try monitoring it on the GPusing using the command nvidia-smi or monitor your CPU/Memory usage when you start it?