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

Loading the model does not work #5

Open
juansgomez87 opened this issue May 6, 2021 · 2 comments
Open

Loading the model does not work #5

juansgomez87 opened this issue May 6, 2021 · 2 comments

Comments

@juansgomez87
Copy link

juansgomez87 commented May 6, 2021

I'm getting errors when trying to load the model. Do you have any suggestions?

model = Word2Vec.load('./models/complete.model')

Traceback (most recent call last):
File "", line 1, in
File "/home/user/.local/lib/python3.8/site-packages/gensim/models/word2vec.py", line 1934, in load
raise ae
File "/home/user/.local/lib/python3.8/site-packages/gensim/models/word2vec.py", line 1922, in load
model = super(Word2Vec, cls).load(*args, **kwargs)
File "/home/user/.local/lib/python3.8/site-packages/gensim/utils.py", line 486, in load
obj = unpickle(fname)
File "/home/user/.local/lib/python3.8/site-packages/gensim/utils.py", line 1458, in unpickle
return _pickle.load(f, encoding='latin1') # needed because loading from S3 doesn't support readline()
AttributeError: Can't get attribute 'Vocab' on <module 'gensim.models.word2vec' from '/home/user/.local/lib/python3.8/site-packages/gensim/models/word2vec.py'>

Update: The model appears not to fail loading when using gensim=3.8.1. However, python crashes when loading. I assume memory issues (?)

@SebastianCB-dev
Copy link

pip install gensim==3.8.1
It worked for me

@GreatNewHope
Copy link

I installed 3.8.3, loaded the model without trouble and then saved it with .save_word2vec_format('vectors.bin', binary=True). This allows the model to be read with latest gensim

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

3 participants