gensim word2vec - array dimensions in updating with online word embedding
I was able to reproduce your error. I think you're calling update=True
when the model is not trained yet. You should only call it when it has been pre-trained.
This works:
import gensimmodel = gensim.models.Word2Vec()sentences = gensim.models.word2vec.LineSentence("text8")model.build_vocab(sentences, update=False)model.train(sentences)model.build_vocab(sentences, update=True)model.train(sentences)
But this will fail:
import gensimmodel = gensim.models.Word2Vec()sentences = gensim.models.word2vec.LineSentence("text8")model.build_vocab(sentences, update=True)model.train(sentences)ValueError: all the input array dimensions except for the concatenation axis must match exactly
Using the latest version of gensim 0.13.4.1.