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

ImportError: cannot import name KeyedVectors #1877

Closed
dhanush-ai1990 opened this issue Feb 4, 2018 · 4 comments
Closed

ImportError: cannot import name KeyedVectors #1877

dhanush-ai1990 opened this issue Feb 4, 2018 · 4 comments

Comments

@dhanush-ai1990
Copy link

Python 2.7.12, Mac OS High Sierra, gensim (0.13.4.1)

from sklearn.externals import joblib
from gensim.models import KeyedVectors

Traceback (most recent call last):
File "Test_for_ adversariality.py", line 5, in
from gensim.models import KeyedVectors
ImportError: cannot import name KeyedVectors

I am trying to load the skipgram.txt files.

@menshikh-iv
Copy link
Contributor

Hello @dhanush987, you have really old gensim version (1 year ago), please upgrade to latest version pip install -U gensim

@Apollo2Mars
Copy link

It should be from gensim.models.keyedvectors import KeyedVector

@NeelKanwal
Copy link

Still I have same problem.


NameError Traceback (most recent call last)
in
----> 1 wv_embeddings = keyedVectors.load_word2vec_format(
2 'GoogleNews-vectors-negative300.bin.gz',
3 binary=True
4 )

NameError: name 'keyedVectors' is not defined

@piskvorky
Copy link
Owner

@NeelKanwal See above.

Repository owner locked and limited conversation to collaborators Aug 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants