Spacy: Issue with inital tests

Created on 30 Nov 2018  路  7Comments  路  Source: explosion/spaCy

Hi.

I'm trying to get started with spacy and I get this issue when running simple code:

import spacy

spacy.prefer_gpu()
nlp = spacy.load('en_core_web_sm')

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/dist-packages/spacy/__init__.py", line 21, in load
return util.load_model(name, overrides)
File "/usr/local/lib/python3.6/dist-packages/spacy/util.py", line 114, in load_model
return load_model_from_package(name, *overrides)
File "/usr/local/lib/python3.6/dist-packages/spacy/util.py", line 135, in load_model_from_package
return cls.load(
overrides)
File "/usr/local/lib/python3.6/dist-packages/en_core_web_sm/__init__.py", line 12, in load
return load_model_from_init_py(__file__, *
overrides)
File "/usr/local/lib/python3.6/dist-packages/spacy/util.py", line 173, in load_model_from_init_py
return load_model_from_path(data_path, meta, *overrides)
File "/usr/local/lib/python3.6/dist-packages/spacy/util.py", line 156, in load_model_from_path
return nlp.from_disk(model_path)
File "/usr/local/lib/python3.6/dist-packages/spacy/language.py", line 647, in from_disk
util.from_disk(path, deserializers, exclude)
File "/usr/local/lib/python3.6/dist-packages/spacy/util.py", line 511, in from_disk
reader(path / key)
File "/usr/local/lib/python3.6/dist-packages/spacy/language.py", line 643, in
deserializers[name] = lambda p, proc=proc: proc.from_disk(p, vocab=False)
File "pipeline.pyx", line 643, in spacy.pipeline.Tagger.from_disk
File "/usr/local/lib/python3.6/dist-packages/spacy/util.py", line 511, in from_disk
reader(path / key)
File "pipeline.pyx", line 626, in spacy.pipeline.Tagger.from_disk.load_model
File "pipeline.pyx", line 627, in spacy.pipeline.Tagger.from_disk.load_model
File "/usr/local/lib/python3.6/dist-packages/thinc/neural/_classes/model.py", line 335, in from_bytes
data = msgpack.loads(bytes_data, encoding='utf8')
File "/usr/local/lib/python3.6/dist-packages/msgpack_numpy.py", line 184, in unpackb
return _unpackb(packed, *
kwargs)
File "msgpack/_unpacker.pyx", line 187, in msgpack._cmsgpack.unpackb
ValueError: 1792000 exceeds max_bin_len(1048576)
```

My server is powerful 16GB and 6CPU, what can be the issue ?

feat / serialize third-party 馃敭 thinc

Most helpful comment

Looks like this is related to today's update of msgpack 馃槥 Working on this, see my comment in #2995:

Looks like it might be related to an update of the msgpack library that was released today and is used in our library thinc, which spaCy depends on. So when you installed spaCy, that new version was pulled in and apparently it includes a change to the limit?

We'll investigate this and hopefully push an update to thinc soon. In the meantime, try downgrading msgpack:

pip install msgpack==0.5.6

All 7 comments

I am getting the same issue. It was working fine before today.

Looks like this is related to today's update of msgpack 馃槥 Working on this, see my comment in #2995:

Looks like it might be related to an update of the msgpack library that was released today and is used in our library thinc, which spaCy depends on. So when you installed spaCy, that new version was pulled in and apparently it includes a change to the limit?

We'll investigate this and hopefully push an update to thinc soon. In the meantime, try downgrading msgpack:

pip install msgpack==0.5.6

I've started experiencing this today as well, whever loading the en_core_web_sm model either with:

import en_core_web_sm
nlp = en_core_web_sm.load()

or having downloaded the model with spacy download

import spacy
nlp = spacy.load('en_core_web_sm')

Interestingly when i run python -m spacy info --markdown it returns: **Models:** en_core_web_lg, despite having loaded en_core_web_sm.

Info about spaCy

  • spaCy version: 2.0.17/2.0.13
  • Platform: Linux-4.15.0-39-generic-x86_64-with-debian-buster-sid
  • Python version: 3.6.4
  • Models: en_core_web_sm

Getting the same kind of issue with msgpack 0.5.6:
File "msgpack/_unpacker.pyx", line 200, in msgpack._unpacker.unpackb ValueError: 2681947787 exceeds max_bin_len(2147483647)

I am getting the same error when I am trying to run:
nlp = spacy.load('en_core_web_sm')

I am getting:
ValueError: 1792000 exceeds max_bin_len(1048576)

Same issue...

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

besirkurtulmus picture besirkurtulmus  路  3Comments

ank-26 picture ank-26  路  3Comments

nadachaabani1 picture nadachaabani1  路  3Comments

melanietosik picture melanietosik  路  3Comments

TropComplique picture TropComplique  路  3Comments