utterworks / fast-bert

Super easy library for BERT based NLP models
Apache License 2.0
1.86k stars 341 forks source link

How do I clear GPU memory after this program finishes running #279

Open callmeYe opened 3 years ago

callmeYe commented 3 years ago

I ran this program on Colab, and when I changed the parameters and tried to run it again, I got an error with CUDA out of memory. I can only kill the python3 process and rerun the entire notebook.

lingdoc commented 1 year ago

torch.cuda.empty_cache()