How to free GPU memory in Pytorch CUDA
I am using Colab and Pytorch CUDA for my deep learning project and faced the problem of not being able to free up the GPU. I have read some related posts here but they did not work with my problem. Please guide me on how to free up the GPU memory.
Thank you in advance

Try this:
torch.cuda.empty_cache()

or this:
with torch.no_grad():
    torch.cuda.empty_cache()

