在 OS X 上的 Jupyter 笔记本中训练 doc2vec 模型时出现以下错误。尽管我已经成功地在其他数据集上训练了模型,但对于我当前的数据集,该错误是可重现的(尽管它发生的特定线程发生了变化)。
Exception in thread Thread-82:
Traceback (most recent call last):
File "/Users/kevinyang/anaconda/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/Users/kevinyang/anaconda/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/Users/kevinyang/anaconda/lib/python3.5/site-packages/gensim/models/word2vec.py", line 822, in worker_loop
tally, raw_tally = self._do_train_job(sentences, alpha, (work, neu1))
File "/Users/kevinyang/anaconda/lib/python3.5/site-packages/gensim/models/doc2vec.py", line 717, in _do_train_job
doctag_vectors=doctag_vectors, doctag_locks=doctag_locks)
File "gensim/models/doc2vec_inner.pyx", line 428, in gensim.models.doc2vec_inner.train_document_dm (./gensim/models/doc2vec_inner.c:5455)
File "mtrand.pyx", line 1266, in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:15836)
RuntimeError: release unlocked lock
Exception in thread Thread-77:
Traceback (most recent call last):
File "/Users/kevinyang/anaconda/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/Users/kevinyang/anaconda/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/Users/kevinyang/anaconda/lib/python3.5/site-packages/gensim/models/word2vec.py", line 822, in worker_loop
tally, raw_tally = self._do_train_job(sentences, alpha, (work, neu1))
File "/Users/kevinyang/anaconda/lib/python3.5/site-packages/gensim/models/doc2vec.py", line 717, in _do_train_job
doctag_vectors=doctag_vectors, doctag_locks=doctag_locks)
File "gensim/models/doc2vec_inner.pyx", line 458, in gensim.models.doc2vec_inner.train_document_dm (./gensim/models/doc2vec_inner.c:5963)
File "mtrand.pyx", line 1266, in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:15836)
RuntimeError: release unlocked lock