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

ValueError: cymem.cymem.Pool has the wrong size, try recompiling #102

Closed
theSage21 opened this issue Oct 16, 2018 · 13 comments
Closed

ValueError: cymem.cymem.Pool has the wrong size, try recompiling #102

theSage21 opened this issue Oct 16, 2018 · 13 comments
Labels

Comments

@theSage21
Copy link

On installing with the en_coref_md link I encountered this error.
Putting it here just in case it reveals a bug somewhere which makes the next release better.
Curiously, on the same machine in another environment the library works fine.

Will update if this goes away due to some action of mine.

alueError                                Traceback (most recent call last)
<ipython-input-1-c6c9a3eec4e0> in <module>
      1 import spacy
----> 2 nlp = spacy.load('en_coref_md')

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/site-packages/spacy/__init__.py in load(name, **overrides)
     19     if depr_path not in (True, False, None):
     20         deprecation_warning(Warnings.W001.format(path=depr_path))
---> 21     return util.load_model(name, **overrides)
     22 
     23 

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/site-packages/spacy/util.py in load_model(name, **overrides)
    112             return load_model_from_link(name, **overrides)
    113         if is_package(name):  # installed as package
--> 114             return load_model_from_package(name, **overrides)
    115         if Path(name).exists():  # path to model data directory
    116             return load_model_from_path(Path(name), **overrides)

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/site-packages/spacy/util.py in load_model_from_package(name, **overrides)
    132 def load_model_from_package(name, **overrides):
    133     """Load a model from an installed package."""
--> 134     cls = importlib.import_module(name)
    135     return cls.load(**overrides)
    136 

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/importlib/__init__.py in import_module(name, package)
    124                 break
    125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
    127 
    128 

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/importlib/_bootstrap_external.py in exec_module(self, module)

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/site-packages/en_coref_md/__init__.py in <module>
      4 from pathlib import Path
      5 from spacy.util import load_model_from_init_py, get_model_meta
----> 6 from en_coref_md.neuralcoref import NeuralCoref
      7 
      8 __version__ = get_model_meta(Path(__file__).parent)['version']

~/.local/share/virtualenvs/squad_analysis-yev1NKHk/lib/python3.6/site-packages/en_coref_md/neuralcoref/__init__.py in <module>
----> 1 from .neuralcoref import NeuralCoref

cymem.pxd in init en_coref_md.neuralcoref.neuralcoref()

ValueError: cymem.cymem.Pool has the wrong size, try recompiling. Expected 64, got 48
@JohnGiorgi
Copy link

JohnGiorgi commented Oct 16, 2018

I got the same error, the solution for me was to downgrade Spacy. Anything between 2.0.11 and 2.0.13 seemed to work. E.g., pip install spacy==2.0.13.

@theSage21
Copy link
Author

theSage21 commented Oct 17, 2018

That fixed it. 👍

Will leave the closure of the issue to library devs in case they want to address this in the next release?

@soumyagk
Copy link

Worked for me with spacy==2.0.12 and thinc==6.10.3. 2.0.11 and 2.0.13 did not work for me.

@jxu
Copy link

jxu commented Nov 18, 2018

Works for me with thinc==6.12.0 and spacy==2.0.13 (however pip reports spacy (2.0.17.dev1)

@wesleytao
Copy link

same problem. But I can't downgrade spacy. Windows will fail to install because of the thinc and other wheel

@ZeroCool2u
Copy link

This is an upstream issue, see: explosion/spaCy#2852

Easiest solution is: pip install spacy==2.0.12

@CptTZ
Copy link

CptTZ commented Dec 8, 2018

If you are in Anaconda environment, you can use: conda install spacy=2.0.12

@mertyildiran
Copy link

mertyildiran commented Jan 6, 2019

I'm re-referencing these issues to each other since there is a version conflict right now and it's not possible to use spacy==2.0.13 anymore because of explosion/spaCy#2995

Please take a look at this comment of mine: explosion/spaCy#2852 (comment)

@greasystrangler
Copy link

I've spent all evening looking through code for both Spacy and Neuralcoref but can't see where the problem lies. It seems there were almost identical bugs in Prodigy explosion/spaCy#2852 as referenced by @mertyildiran and there the fix was in Prodigy, and seemingly not Spacy and not the supporting libraries thinc and msgpack

I can confirm that installing spacy==2.0.12 and msgpack==5.6.5 does work but it is not a good solution in the longer term.

Has anybody managed to get Neuralcoref running at all in 2.0.18?

@thomwolf
Copy link
Member

All these issues should be fixed with the new release (NeuralCoref 4.0) and SpaCy 2.1+.
Feel free to open new issues if some installation problem are still there.

@bmizhen-exos
Copy link

Same problem.

Python 3.7 on Mac
neuralcoref 4.0
spacy 2.1.3

    from .neuralcoref import NeuralCoref
  File "cymem.pxd", line 1, in init en_coref_lg.neuralcoref.neuralcoref
ValueError: cymem.cymem.Pool has the wrong size, try recompiling. Expected 64, got 48
beautifulsoup4  4.7.1
biopython       1.73
blis            0.2.4
boto3           1.9.138
botocore        1.12.138
certifi         2019.3.9
chardet         3.0.4
cymem           2.0.2
dateparser      0.7.1
docutils        0.14
en-core-web-lg  2.1.0
en-coref-lg     3.0.0
idna            2.8
isodate         0.6.0
jmespath        0.9.4
jsonschema      2.6.0
lxml            4.3.3
murmurhash      1.0.2
neuralcoref     4.0
nltk            3.4.1
numpy           1.16.3
ordered-set     3.1.1
pandas          0.24.2
Pillow          6.0.0
pip             19.1
plac            0.9.6
preshed         2.0.1
pyparsing       2.4.0
python-dateutil 2.8.0
python-docx     0.8.10
pytz            2019.1
rdflib          4.2.2
regex           2019.4.14
requests        2.21.0
s3transfer      0.2.0
setuptools      41.0.1
singledispatch  3.4.0.3
six             1.12.0
soupsieve       1.9.1
spacy           2.1.3
srsly           0.0.5
thinc           7.0.4
tqdm            4.31.1
tzlocal         1.5.1
urllib3         1.24.2
wasabi          0.2.1
wheel           0.33.1
word2number     1.1

@paudelra
Copy link

Same issue here as well

@xinsheng44
Copy link

i meet same problem,but there is no any solution

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

No branches or pull requests