import gc
import torch

del model
gc.collect()
torch.cuda.empty_cache()
Last modification:February 13, 2022
If you think my article is useful to you, please feel free to appreciate