title: cuda out of memory while trying to train a model with Transformer model of spacy
body: <p>I'm trying to train a custom NER model on top of Spacy transformer model.
  For faster training, I'm running it on a GPU with cuda on Google Colab Pro with High-Ram server.</p>
  <p>After the first iteration, I get an error:</p>
  <blockquote>
  <p>RuntimeError: CUDA out of memory. Tried to allocate 480.00 MiB (GPU 0;
  11.17 GiB total capacity; 9.32 GiB already allocated; 193.31 MiB free; 10.32 GiB reserved in total by PyTorch)</p>
  </blockquote>
  <p>For the above error I tried emptying cache too. But still I'm getting this error. Seems like it’s not freeing up enough space.</p>
  <pre><code>import torch
  torch.cuda.empty_cache()
  </code></pre>
  <p>Moreover I also tried reducing the batch sizes even to 2. Still the same error occurs.</p>