Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU support - cuda 11.1 - TypeError: Unsupported type <class 'numpy.ndarray'> #345

Open
bryanjohns opened this issue May 4, 2022 · 0 comments

Comments

@bryanjohns
Copy link

Example:

import spacy

spacy.require_gpu()
>> True

nlp = spacy.load("en_core_web_sm")
doc = nlp("this is my example text")
print(doc)
>> this is my example text

import neuralcoref
neuralcoref.add_to_pipe(nlp)
>> <spacy.lang.en.English object at 0x7f53d9da6d60>

doc =  nlp("this is my example text")
>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/brj/.local/share/virtualenvs/spacy-ozIRu_0L/lib/python3.8/site-packages/spacy/language.py", line 445, in __call__
    doc = proc(doc, **component_cfg.get(name, {}))
  File "neuralcoref.pyx", line 593, in neuralcoref.neuralcoref.NeuralCoref.__call__
  File "neuralcoref.pyx", line 720, in neuralcoref.neuralcoref.NeuralCoref.predict
  File "neuralcoref.pyx", line 908, in neuralcoref.neuralcoref.NeuralCoref.get_mention_embeddings
  File "neuralcoref.pyx", line 899, in neuralcoref.neuralcoref.NeuralCoref.get_average_embedding
  File "cupy/_core/core.pyx", line 1591, in cupy._core.core.ndarray.__array_ufunc__
  File "cupy/_core/_kernel.pyx", line 1218, in cupy._core._kernel.ufunc.__call__
  File "cupy/_core/_kernel.pyx", line 138, in cupy._core._kernel._preprocess_args
  File "cupy/_core/_kernel.pyx", line 124, in cupy._core._kernel._preprocess_arg
TypeError: Unsupported type <class 'numpy.ndarray'>

# printing versions
import cupy
spacy.__version__
>> 2.3.7
neuralcoref.__version__
>> 4.1.0
cupy.__version__
>> 10.4.0

Everything works fine if I run this without spacy.require_gpu().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant