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

Can't get attribute 'Vocab' on <module 'gensim.models.word2vec' #12

Open
chuqingzhao opened this issue Feb 5, 2022 · 1 comment
Open

Comments

@chuqingzhao
Copy link

Does anyone encounter the same issue when loading the model?

model = gensim.models.Word2Vec.load('/home/cqzhao/Computational Content Analysis/data/1992embeddings_hs_new3.sg')

image

@jacyanthis
Copy link
Member

jacyanthis commented Feb 6, 2022

This is a version incompatibility issue. If you run the code gensim.__version__, you will probably see '4.0.0' or later, but the 1992embeddings_hs_new3.sg was made in a previous version that can't be straightforwardly loaded in the most recent version. It's strange that Gensim did not make their own objects backwards-compatible, especially something as popular as word2vec embeddings.

You can run code like !pip install gensim==3.8.3 (the last v3 of Gensim) and restart your notebook to load that file. (This is pretty straightforward on Google Colab but can be messier on your local machine.) I'm working on a better solution that doesn't require installing an old version and will update in this thread when/if I find one. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants