Comments (21)
Why this error??
import spacy
spacy.load('en_coref_sm')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/spacy/init.py", line 19, in load
return util.load_model(name, **overrides)
File "/usr/local/lib/python2.7/dist-packages/spacy/util.py", line 115, in load_model
return load_model_from_package(name, **overrides)
File "/usr/local/lib/python2.7/dist-packages/spacy/util.py", line 138, in load_model_from_package
return cls.load(**overrides)
File "/usr/local/lib/python2.7/dist-packages/en_coref_sm/init.py", line 15, in load
coref = NeuralCoref(nlp.vocab)
File "neuralcoref.pyx", line 529, in en_coref_sm.neuralcoref.neuralcoref.NeuralCoref.init
File "doc.pyx", line 100, in spacy.tokens.doc.Doc.set_extension
AssertionError
from neuralcoref.
Hi,
The issue is not related to Ubuntu it seems. I was using Python2.7 version before. I tried with Python 3.4. Now it is working fine. Is there any options to make it run on Python2.7 itself??
from neuralcoref.
hi @Praveenabiginfo, can you give me some information on your setup. Are you under windows, linux or mac and which version of python / environment manager you are using ?
from neuralcoref.
from neuralcoref.
Under neuralcoref 3.0 is from neuralcoref import Coref
still working? I was reading your traceback and from there it appears that you're importing it using that statement.
@Praveenabiginfo does
import spacy
nlp = spacy.load('en_coref_sm')
solve your problem/work as expected?
from neuralcoref.
from neuralcoref.
I am uploading updated versions of the models (en_coref_sm
is up, the others are still currently uploading) which should work with the original readme instructions (fixed the install scripts).
from neuralcoref.
from neuralcoref.
from neuralcoref.
Hi @Praveenabiginfo, I released a set of updated models just this morning. Can you try them instead of the old ones? I tested them on Python 2.7 and 3.6. See my last post in issue #47 for details.
from neuralcoref.
from neuralcoref.
Try to download them again please (I updated them several times this morning)
from neuralcoref.
from neuralcoref.
Ok I see, thanks for trying. I have to update the instal script for Ubuntu indeed.
I need to first setup an Ubuntu machine to test it.
I will come back to you when I managed to fix that.
from neuralcoref.
Today I again tried in a different machine which doesn't even have the spacy.
I installed spacy and then installed spacy model "sm" and then installed this new model of coref "sm" and installed Cython and did that steps from github specified in the document. All went well. But when I tried to load the new coref model again I got the same error.. Below is that error.
import spacy
spacy.load('en_coref_sm')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/spacy/init.py", line 15, in load
return util.load_model(name, **overrides)
File "/usr/local/lib/python2.7/dist-packages/spacy/util.py", line 114, in load_model
return load_model_from_package(name, **overrides)
File "/usr/local/lib/python2.7/dist-packages/spacy/util.py", line 134, in load_model_from_package
cls = importlib.import_module(name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/local/lib/python2.7/dist-packages/en_coref_sm/init.py", line 6, in
from en_coref_sm.neuralcoref import NeuralCoref
File "/usr/local/lib/python2.7/dist-packages/en_coref_sm/neuralcoref/init.py", line 1, in
from .neuralcoref import NeuralCoref
File "neuralcoref.pyx", line 101, in init en_coref_sm.neuralcoref.neuralcoref
TypeError: must be char, not unicode
from neuralcoref.
Well it is working on my mac (OS Sierra) on Python 2.7 so I am a bit puzzled.
Can you try installing a full clean version with
pip install --upgrade --force-reinstall --no-cache-dir MODEL_URL
from neuralcoref.
from neuralcoref.
from neuralcoref.
I'm also having this issue, I'm using python 2.7.6 on a Ubuntu 14.04.
This is the full traceback:
In [1]: import spacy; spacy.load('en_coref_sm')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-bd9aa5b27231> in <module>()
----> 1 import spacy; spacy.load('en_coref_sm')
/home/ubuntu/.virtualenvs/apex/local/lib/python2.7/site-packages/spacy/__init__.pyc in load(name, **overrides)
13 if depr_path not in (True, False, None):
14 deprecation_warning(Warnings.W001.format(path=depr_path))
---> 15 return util.load_model(name, **overrides)
16
17
/home/ubuntu/.virtualenvs/apex/local/lib/python2.7/site-packages/spacy/util.pyc 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)
/home/ubuntu/.virtualenvs/apex/local/lib/python2.7/site-packages/spacy/util.pyc 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
/usr/lib/python2.7/importlib/__init__.pyc in import_module(name, package)
35 level += 1
36 name = _resolve_name(name[level:], package, level)
---> 37 __import__(name)
38 return sys.modules[name]
/home/ubuntu/.virtualenvs/apex/local/lib/python2.7/site-packages/en_coref_sm/__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_sm.neuralcoref import NeuralCoref
7
8 __version__ = get_model_meta(Path(__file__).parent)['version']
/home/ubuntu/.virtualenvs/apex/local/lib/python2.7/site-packages/en_coref_sm/neuralcoref/__init__.py in <module>()
----> 1 from .neuralcoref import NeuralCoref
neuralcoref.pyx in init en_coref_sm.neuralcoref.neuralcoref()
TypeError: must be char, not unicode
Initially I hit the AssertionError
@Praveenabiginfo mentioned on Jun 27th, I fixed that by upgrading spacy from 2.0.7 to 2.0.12. Now I'm stuck with this TypeError
when loading the model from spacy.
from neuralcoref.
This should be fixed in the latest release (4.0).
from neuralcoref.
Facing same iussue:
neuralcoref 4.0
spacy 2.1.0
/data/saurabh/neuralcoref/neuralcoref/init.py in ()
12 warnings.filterwarnings("ignore", message="spacy.strings.StringStore size changed")
13
---> 14 from .neuralcoref import NeuralCoref
15 from .file_utils import NEURALCOREF_MODEL_URL, NEURALCOREF_MODEL_PATH, NEURALCOREF_CACHE, cached_path
16
neuralcoref.pyx in init neuralcoref.neuralcoref()
TypeError: must be char, not unicode
from neuralcoref.
Related Issues (20)
- Wrong average embedding during inference due to a small bug in neuracoref.pyx
- Missing implementation of doc embeddings during inference
- Wrong Mention Type one-hot vectors during training due to a small bug in dataset.py
- Training Dataset Format
- Can't install neuralcoref, keep getting this error: C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 HOT 4
- Error in training without changing anything from the default instructions
- GPU support - cuda 11.1 - TypeError: Unsupported type <class 'numpy.ndarray'>
- (base) C:\Users\sk136\neuralcoref>python -m neuralcoref.train.learn --train ./data/train/ --eval ./data/dev/ facing problem while executing.. this command HOT 1
- Results completely differ from web-demo
- Compatibility with Spacy 3+ HOT 7
- Regarding finetuning neuralcoref
- dels HOT 1
- neuralcoref not supporting python 3.9 version HOT 1
- spacy.strings.StringStore size changed, may indicate binary incompatibility HOT 5
- Dependency Problem HOT 1
- I can't install neuralcoref HOT 8
- Unresolved dependencies?
- Kernel crashes when trying to run demo code HOT 1
- Process finished with exit code -1073741819 (0xC0000005)
- installation failed with HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neuralcoref.