Hi everyone,
I have trouble to get the IMBD text classification model to train within the first notebook (01_Intro.ipynb)
I followed the advice of reducing the batch size. However, I get a “CUDA out of memory” error even when I reduce the batch size to the minimum amount of 2:
from fastai.text.all import *
dls = TextDataLoaders.from_folder(untar_data(URLs.IMDB), valid='test', bs=2)
learn = text_classifier_learner(dls, AWD_LSTM, drop_mult=0.5, metrics=accuracy)
learn.fine_tune(4, 1e-2)
CUDA out of memory. Tried to allocate 92.00 MiB (GPU 0; 3.95 GiB total capacity; 3.18 GiB already allocated; 40.19 MiB free; 3.34 GiB reserved in total by PyTorch)
I have a GTX1050Ti with 4GB of VRAM.
According to nvtop the kernel of Jupyter notebooks uses 3975MiB of VRAM within the GPU when the training dies with the remaining 54MiB being used by the X server.
Is this amount of memory consumption to be expected or is there any workaround for this?
I understand that large models require lots of memory on the GPU but I am surprised that 4GB of VRAM are not enough for a simple text classification/sentiment analysis task.
Many thanks!
Christian