aitoralmeida / spanish_word2vec

Ready to use Spanish Word2Vec embeddings created from >18B chars and >3B words
38 stars 5 forks source link

Loading the model does not work #5

Open juansgomez87 opened 3 years ago

juansgomez87 commented 3 years ago

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 commented 1 year ago

pip install gensim==3.8.1 It worked for me