Created
March 31, 2023 17:30
-
-
Save milyiyo/bb2542ca5008c1ca206a5cef951deeb2 to your computer and use it in GitHub Desktop.
Clean the RAM and GPU in a Colab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gc | |
import torch | |
gc.collect() | |
with torch.no_grad(): | |
torch.cuda.empty_cache() | |
!nvidia-smi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment