Spacy installation isn't installing correct pytorch version for gpu support on windows #8146
-
On Windows when I install spacy using this command
torch doesn't end up being installed with cuda support
Instead I have to start from a new environment, I FIRST have to install the correct torch version for my cuda version from the commands provided on pytorch website
Then After torch installation is complete I can run the install command for spacy
And then it will work, if I do it the other way around (install spacy first, then reinstall torch, I get an error when I try to |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Sorry that doesn't work, and thanks for the detailed explanation. I think we don't require torch directly, but instead it's pulled in via Transformers, so there may not be much we can do about this beyond documenting it better, but we're aware that installing is prone to problems and always looking for ways to improve it. |
Beta Was this translation helpful? Give feedback.
-
Yes, it's best to follow the pytorch instructions because Here are our general recommendations: https://spacy.io/usage/embeddings-transformers#transformers-installation You can also install |
Beta Was this translation helpful? Give feedback.
Yes, it's best to follow the pytorch instructions because
pip
can't really detect the right CUDA settings. We'd also recommend using the pytorch conda instructions in a conda venv, since that may be a better match for the rest of the environment.Here are our general recommendations: https://spacy.io/usage/embeddings-transformers#transformers-installation
You can also install
spacy
fromconda-forge
instead, but we don't haveconda-forge
packages for every single extra package likespacy-transformers
orspacy-lookups-data
, in particular not for the pure python packages. I thinktransformers
recently added support for conda, but similarly with their own custom directions requiring a specifi…