Yuhan's blog
Coder.
Thursday, August 10, 2023
Pytorch: How to clear GPU memory
import
gc
# del optimizer
# del model
gc.collect()
torch.cuda.empty_cache()
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment