Skip to content

Commit 39cfc53

Browse files
committed
Better wording, just a warning - no longer an exception
Dat piskvorky#443
1 parent 5934788 commit 39cfc53

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

gensim/models/word2vec.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -756,13 +756,11 @@ def worker_loop():
756756
next_alpha = self.alpha - (self.alpha - self.min_alpha) * (pushed_words / total_words)
757757
next_alpha = max(next_alpha, self.min_alpha)
758758
except StopIteration:
759-
if job_no == -1 and self.corpus_count > 0:
760-
raise Exception(
761-
"Caught StopIteration before performing any work, and "
762-
"yet the corpus count is > 0. Are you by any chance "
763-
"trying to train on an iterator that is based on a "
764-
"generator that does not re-initialize itself? See "
765-
"https://github.com/piskvorky/gensim/issues/443"
759+
if job_no == -1 and self.train_count == 0:
760+
logger.warning(
761+
"train() called with empty iterator (if not intended, "
762+
"be sure to provide a corpus that offers restartable "
763+
"iteration)."
766764
)
767765
logger.info(
768766
"reached end of input; waiting to finish %i outstanding jobs",

0 commit comments

Comments
 (0)