fractalego/chatbots-dialogues-test

Error while training

Closed this issue · 3 comments

Hi, I am getting the error below while training the network.

python3 train_word2vec_model.py
Training epoch 0.
Traceback (most recent call last):
File "train_word2vec_model.py", line 60, in
model.train(sentences.sentences_perm())
File "/home/leena/anaconda3/envs/python3/lib/python3.6/site-packages/gensim/models/word2vec.py", line 903, in train
"You must specify either total_examples or total_words, for proper alpha and progress calculations. "
ValueError: You must specify either total_examples or total_words, for proper alpha and progress calculations. The usual value is total_examples=model.corpus_count.

Do I need to pass any other arguments?

This is an issue related to gensim. Making this change in the 'train_word2vec_model.py' file worked for me:

model.train(sentences.sentences_perm(), total_examples=model.corpus_count, epochs=model.iter)

Thank you!
I believe this change is due to gensim's new version. I have now updated the code with a requirement file.

Please let me know if other issues arise. I only used this code for the blog post.

Thank you o much for the update. I will raise issues if I find any.