Would somebody suggest how to clear CUDA memory?
Thank you so much.
Would somebody suggest how to clear CUDA memory?
Thank you so much.
torch.cuda.empty_cache()
allows to clear cached memory. However, you should not use it owing to the next fact:
Pytorch does not release the memory back to the OS when you remove Tensors on the GPU, it keeps it in a pool so that next allocations can be done much faster.