title: How to clear GPU memory after using model?
body: <p>I'm trying to free up GPU memory after finishing using the model.</p>
  <ul>
  <li>I checked the <code>nvidia-smi</code> before creating and trainning the model: <code>402MiB /  7973MiB</code></li>
  <li>After creating and training the model, I checked again the GPU memory status with  <code>nvidia-smi</code>: <code>7801MiB /  7973MiB</code></li>
  <li>Now I tried to free up GPU memory with:</li>
  </ul>
  <pre><code>del model
  torch.cuda.empty_cache() 
  gc.collect()
  </code></pre>
  <p>and checked again the GPU memory:  <code>2361MiB /  7973MiB</code></p>
  <ul>
  <li>As you can see not all the GPU memory was released (<strong>I expected to get</strong> 400~MiB / 7973MiB).</li>
  <li>I can only relase the GPU memory via terminal (<code>sudo fuser -v /dev/nvidia*</code>  and <code>kill</code> pid)</li>
  </ul>
  <p>Is there a way to free up the GPU memory after I done using the model ?</p>