You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I don't know which version of Gensim you are using but I can tell you that in versions >=4 the _l2_norm function has been removed from keyedvectors.py.
You can either choose to
edit your locally downloaded version of Gensim replacing _l2_norm with linalg.norm after adding linalg to the numpy import in the file's imports section
update your fse with the porting I just made for Gensim >=4 (which also solves this problem) by executing the command
ImportError Traceback (most recent call last)
in ()
----> 1 from fse import Vectors, Average, IndexedList
2 vecs = Vectors.from_pretrained("fasttext-wiki-news-subwords-300")
3 model = Average(vecs)
3 frames
/usr/local/lib/python3.7/dist-packages/fse/models/base_s2v.py in ()
40
41 from gensim.models.base_any2vec import BaseWordEmbeddingsModel
---> 42 from gensim.models.keyedvectors import BaseKeyedVectors, FastTextKeyedVectors, _l2_norm
43 from gensim.utils import SaveLoad
44 from gensim.matutils import zeros_aligned
ImportError: cannot import name '_l2_norm' from 'gensim.models.keyedvectors' (/usr/local/lib/python3.7/dist-packages/gensim/models/keyedvectors.py)
The text was updated successfully, but these errors were encountered: