I train and save a gensim word2vec model:
W2V_MODEL_FN = r"C:\Users\models\w2v.model"
model = Word2Vec(X, size=150, window=3, min_count=2, workers=10)
model.train(X, total_examples=len(X), epochs=50)
model.save(W2V_MODEL_FN)
And then:
w2v_model = Word2Vec.load(W2V_MODEL_FN)
On one enviroment it works perfectly but in another I get the error:
{AttributeError}Can't get attribute 'Word2VecKeyedVectors' on module 'gensim.models.keyedvectors' from 'C:\Users\Anaconda3_New\envs\ISP_env\lib\site-packages\gensim\models\keyedvectors.py'>
So I guess it might be a package version issue?
But I couldn't figure what it is. Any ideas?
Thanks!
Thanks to @oren_jsp answer to question.
pip3 install --upgrade gensim --user
It solved my problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With