-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error with the training command #16
Comments
try I'll update this during the weekend |
Let me know if it works! |
First I changed the line into: _Exception in thread Thread-13: |
Try model.iter()
…On Jul 22, 2017 7:12 PM, "RenatoPerotti" ***@***.***> wrote:
I changed the line into:
model.train(sentences.sentences_perm, total_examples=model.corpus_count,
epochs=model.iter)
but now I get a more complex error message:
_Exception in thread Thread-13:
Traceback (most recent call last):
File "E:\Python3\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "E:\Python3\lib\threading.py", line 864, in run
self._target(*self._args, **self.
*kwargs) File "E:\Python3\lib\site-packages\gensim\models\word2vec.py",
line 854, in job_producer for sent_idx, sentence in enumerate(sentences):
File "E:\Python3\lib\site-packages\gensim\utils.py", line 687, in iter for
document in self.corpus: TypeError: 'method' object is not iterable*
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACZ8yg8PDLNfZv6qSyCJdtoAr3EWdgJgks5sQoHngaJpZM4OeGri>
.
|
Nope, I get that it is not callable again (like the first issue we had with corpus_count): TypeError: 'int' object is not callable _ |
This one worked for me: model.train(sentences.sentences_perm(), total_examples=model.corpus_count, epochs=model.iter) |
Hello Guy, I'm using the following command:
sentences.sentences_perm(), not work !! Thanks for help |
Sorry I have no time to update this right now. @eriksonJAguiar can you let me know the versions of python and gensim you're using? If it's the latest, I'll just make the change you mentioned. Thanks! |
Hi @linanqiu, I'm using Python 3.5 and gensim 2.3.0 !! |
Hello, I'm using the following command: |
Hello there, I tried the command but I am getting the error
when I tried :
but I mentioned the epochs as mentioned, but I still got the error.
Can you tell me what the problem is ? Regards, |
Hi Shashank, It works! And got almost same results. 0.86464 |
` from future import absolute_import, division, print_function import nltk import warnings import gensim corpus_raw = u"" #convert into a list of words print(raw_sentences[5]) #ONCE we have vectors Dimensionality of the resulting word vectors.#more dimensions, more computationally expensive to train Minimum word count threshold.min_word_count = 3 Number of threads to run in parallel.#more workers, faster we train Context window length.context_size = 7 Downsample setting for frequent words.#0 - 1e-5 is good for this Seed for the RNG, to make the results reproducible.#random number generator print("Word2Vec vocabulary length:", len(word2vec.wv.vocab)) ValueError Traceback (most recent call last) ~\Anaconda3\lib\site-packages\gensim\models\word2vec.py in train(self, sentences, total_examples, total_words, epochs, start_alpha, end_alpha, word_count, queue_factor, report_delay, compute_loss, callbacks) ~\Anaconda3\lib\site-packages\gensim\models\base_any2vec.py in train(self, sentences, total_examples, total_words, epochs, start_alpha, end_alpha, word_count, queue_factor, report_delay, compute_loss, callbacks) ~\Anaconda3\lib\site-packages\gensim\models\base_any2vec.py in train(self, data_iterable, epochs, total_examples, total_words, queue_factor, report_delay, callbacks, **kwargs) ~\Anaconda3\lib\site-packages\gensim\models\base_any2vec.py in _check_training_sanity(self, epochs, total_examples, total_words, **kwargs) ValueError: You must specify either total_examples or total_words, for proper job parameters updationand progress calculations. The usual value is total_examples=model.corpus_count. |
You can give explicit epochs value like 20, just as stated in the error. It worked for me! |
I may be able to help you if you send me the code in full to check.
On Sat, 16 Nov 2019 at 2:15 PM, Anshika Agrawal ***@***.***> wrote:
Hello there,
I tried the command but I am getting the error
raise ValueError("You must specify an explict epochs count. The usual
value is epochs=model.epochs.")
ValueError: You must specify an explict epochs count. The usual value is
epochs=model.epochs.
when I tried :
model_dm.train(perm_sentences,
total_examples=model_dm.corpus_count,epochs=model_dm.epochs)
but I mentioned the epochs as mentioned, but I still got the error.
Python version : 3.5
Gensim version : 3.4
Can you tell me what the problem is ?
Regards,
Shashank Reddy Boosi.
You can give explicit epochs value like 20, just as stated in the error.
It worked for me!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#16?email_source=notifications&email_token=AAU3VQWUE537DIS3PANXQ5LQT6XKXA5CNFSM4DTYNLRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEHMXBY#issuecomment-554617735>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAU3VQU6YNZHG3NGI5SX4KTQT6XKXANCNFSM4DTYNLRA>
.
--
Thanks & Regards,
Suresh Babu
|
Yep. That is how it works I guess. |
The new word2vec requires total_examples to be specified in the train command, now it gives the error:
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.
so I changed it to the following:
model.train(sentences.sentences_perm,total_examples=model.corpus_count())
but it gives a new error:
TypeError: 'int' object is not callable
Does anyone have an idea what to do with this?
The text was updated successfully, but these errors were encountered: