DeprecationWarning from `spacy_legacy`
See original GitHub issueHi there,
I recently upgraded to spacy 3 and scispacy 0.4, but I am now getting a warning whenever I use the small scispacy
model (I have not tried any other model).
I am getting a DeprecationWarning
on a fresh install in python 3.8 with the latest version of scispacy
and en_core_sci_sm
.
Steps to reproduce:
pip install scispacy
pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.4.0/en_core_sci_sm-0.4.0.tar.gz
import spacy
nlp = spacy.load("en_core_sci_sm")
import warnings
warnings.filterwarnings("error")
nlp("Hello World")
Any input to the nlp
model triggers the same warning:
/opt/miniconda3/envs/clean/lib/python3.8/site-packages/spacy_legacy/layers/staticvectors_v1.py in forward(model, docs, is_train)
43 )
44 try:
---> 45 vectors_data = model.ops.gemm(model.ops.as_contig(V[rows]), W, trans2=True)
46 except ValueError:
47 raise RuntimeError(Errors.E896)
DeprecationWarning: Out of bound index found.
This was previously ignored when the indexing result contained no elements.
In the future the index error will be raised.
This error occurs either due to an empty slice, or if an array has zero elements even before indexing.
(Use `warnings.simplefilter('error')` to turn this DeprecationWarning into an error and get more details on the invalid index.)
Any ideas as to how to resolve this without manually ignoring the warning?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
Depricationwarning in simple test case · Issue #8046 - GitHub
This is a first time install of spaCy, CuPy, CUDA, etc. I think this is a packaging warning that may be unique to...
Read more >spacy-legacy - PyPI
This package includes outdated registered functions for spaCy v3. x, for example model architectures, pipeline components and utilities.
Read more >Spacy linking deprecation error - Rasa Community Forum
This is caused by model: external_data/spacy.word2vec.model in your pipeline. Same error, but not same cause. Do you need that model?
Read more >Changes — textacy 0.11.0 documentation
The legacy function text_stats.readability_stats() still exists and behaves as before, but a deprecation warning is displayed. Added functions ...
Read more >Legacy functions and architectures · spaCy API Documentation
The spacy-legacy package includes outdated registered functions and architectures. It is installed automatically as a dependency of spaCy, and provides ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, this is one of those cases where I hesitate to describe a workaround, even though I think it’s technically possible (you’d have to replace
MultiHashEmbed
andStaticVectors
with custom code).But I really wouldn’t recommend it, especially for a widely distributed model, so my official answer is: no, I would retrain the model with the corrected config.
Hi, it looks like
en_core_sci_sm
hasinclude_static_vectors = true
even though there are no vectors, which leads to this deprecation warning innumpy>=1.20.0
.