You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gensim.models.word2vec: reset_from seems to use the wrong variables for vocab and index2word
Steps/Code/Corpus to Reproduce
from gensim.models import word2vec
sentences = ['human', 'machine']
model = word2vec.Word2Vec()
model.build_vocab(sentences)
new_model = word2vec.Word2Vec()
new_model.reset_from(model)
Expected Results
new_model initialized with settings from model
Actual Results
Traceback (most recent call last):
File "test.py", line 8, in
new_model.reset_from(model)
File "/usr/local/lib/python2.7/dist-packages/gensim/models/word2vec.py", line 734, in reset_from
self.wv.vocab = other_model.vocab
AttributeError: 'Word2Vec' object has no attribute 'vocab'
Versions
gensim 1.0.1
Fix
gensim/models/word2vec.py
Line 734 change
self.wv.vocab = other_model.vocab
to
self.wv.vocab = other_model.wv.vocab
Line 735 change
self.wv.index2word = other_model.index2word
to
self.wv.index2word = other_model.wv.index2word
The text was updated successfully, but these errors were encountered:
Description
gensim.models.word2vec: reset_from seems to use the wrong variables for vocab and index2word
Steps/Code/Corpus to Reproduce
Expected Results
new_model initialized with settings from model
Actual Results
Traceback (most recent call last):
File "test.py", line 8, in
new_model.reset_from(model)
File "/usr/local/lib/python2.7/dist-packages/gensim/models/word2vec.py", line 734, in reset_from
self.wv.vocab = other_model.vocab
AttributeError: 'Word2Vec' object has no attribute 'vocab'
Versions
gensim 1.0.1
Fix
gensim/models/word2vec.py
Line 734 change
self.wv.vocab = other_model.vocab
to
self.wv.vocab = other_model.wv.vocab
Line 735 change
self.wv.index2word = other_model.index2word
to
self.wv.index2word = other_model.wv.index2word
The text was updated successfully, but these errors were encountered: