NLP Classification - imdb out of memory

Do you have only one model? In the notebook there is learner vs. learn and my impression was that something stays around there. If you are on PyTorch 0.4+ you might also see about using with torch.no_grad(): for evaluation.
In recent PyTorch you can check with torch.cuda.memory_allocated() how much of your GPU memory is used (and not just cached). This should ideally be the memory for the weights. It’ll go up during the forward passes during training, but should be lower again after backward.
I hope this is useful for you, I never dug all that deep into it but just reloaded the kernel and loaded the model I had up to then and continued.

Best regards

Thomas