Reputation: 41
I have 40,000 records and I the training process is very slow, this is the line I use in colab for training
! python -m spacy train config.cfg --output /content/ --paths.train /content/training_data.spacy --paths.dev /content/training_data.spacy
when I run this cell, this show up
ℹ Saving to output directory: /content
ℹ Using CPU
ℹ To switch to GPU 0, use the option: --gpu-id 0
I want to use the GPU
but when I use the --gpu-id 0
in end of cell command, I got ERROR
and I changed runtime of colab to GPU
Upvotes: 1
Views: 3902
Reputation: 551
The key steps to make it happen are:
enable the GPU (edit -> notebook settings -> hardware acceleration)
install spacy with CUDA support (pip install spacy[cuda100]
)
Validate if it is all set by running the following code (it must return True
):
import spacy
gpu = spacy.prefer_gpu()
print(gpu)
If it is true, then your env is ready to run spacy with GPU support.
Upvotes: 5