You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
01alex opened this issue
Mar 19, 2019
· 4 comments
Labels
bugBugs and behaviour differing from documentationinstallInstallation issues🔮 thincspaCy's machine learning library ThincupgradeIssues related to upgrading spaCy
!pip install -U spacy
!python -m spacy download en
import spacy
gpu = spacy.prefer_gpu()
print('GPU:', gpu)
nlp = spacy.load("en_core_web_sm")
doc = nlp("This is a sentence. This is another sentence.")
for sent in doc.sents:
print(sent.text)
Output
GPU: True
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-1313493bc47b> in <module>()
6 nlp = spacy.load("en_core_web_sm")
7
----> 8 doc = nlp("This is a sentence. This is another sentence.")
9 for sent in doc.sents:
10 print(sent.text)
(...)
ops.pyx in thinc.neural.ops.CupyOps.hash()
NameError: name 'gpu_ops' is not defined
This exact same code worked yesterday with the previous release.
Note
If I do:
!pip uninstall thinc
!pip install thinc==7.0.3
It works correctly:
GPU: True
This is a sentence.
This is another sentence.
Did you install the new version in the same environment as the old one, and did you specify your CUDA version as described here? It's possible that you ended up with stale files or packages in your site-packages, or Thinc didn't correctly pull in the thinc_gpu_ops.
Checked version 2.1.0. Ran the example snippet. It works fine on cpu. Required gpu and got the same error.
It was working fine yesterday with spaCy 2.0.18.
Thanks, this was a regression introduced when fixing #3430 .
Thinc v7.0.3 required the thinc_gpu_ops module, which caused problems if CUDA was installed but no GPU was available (or if no compiler was installed).
The fix is to make the thinc_gpu_ops module an extras_require. This was set correctly in Thinc v7.0.4, but I didn't set it in spaCy. Have triggered a build for v2.1.1 to fix this.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
lockbot
locked as resolved and limited conversation to collaborators
Apr 19, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugBugs and behaviour differing from documentationinstallInstallation issues🔮 thincspaCy's machine learning library ThincupgradeIssues related to upgrading spaCy
How to reproduce the behaviour
Output
This exact same code worked yesterday with the previous release.
Note
If I do:
It works correctly:
Your Environment
The text was updated successfully, but these errors were encountered: