Does reducing your batch size help? Can you post your full training script? Have you tried the diagnoses at https://pytorch.org/docs/stable/notes/faq.html#my-model-reports-cuda-runtime-error-2-out-of-memory 488 ?