alex-tifrea / poincare_glove

Implementation of the "Poincare Glove: Hyperbolic word embeddings" paper
GNU Lesser General Public License v2.1
83 stars 20 forks source link

TypeError: C variable gensim.models.word2vec_inner.scopy has wrong signature #5

Closed snooker-player closed 5 years ago

snooker-player commented 5 years ago

I tried to run the training but the training did not start because of the following error:

Running python3 glove_code/scripts/glove_main.py --train --root=.. --coocc_file=data/demo/cooccurrence.bin --vocab_file=data/demo/vocab.txt --size=100 --workers=20 --chunksize=1000 --epochs=50 --lr=0.05 --restrict_vocab=200000 --coocc_func log --bias --train_log_filename ../train_logs/tmp_a283c Redirecting output to ../train_logs/train_glove_ep50_size100_lr0.05_vocab200000_vanilla_OPTadagrad_COOCCFUNClog_bias Traceback (most recent call last): File "glove_code/scripts/glove_main.py", line 4, in import gensim File "/home/usr/Work/poincare_glove/poincare_glove/gensim/init.py", line 5, in from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401 File "/home/usr/Work/poincare_glove/poincare_glove/gensim/models/init.py", line 15, in from .doc2vec import Doc2Vec # noqa:F401 File "/home/usr/Work/poincare_glove/poincare_glove/gensim/models/doc2vec.py", line 78, in from gensim.models.doc2vec_inner import train_document_dbow, train_document_dm, train_document_dm_concat File "gensim/models/doc2vec_inner.pyx", line 1, in init gensim.models.doc2vec_inner

!/usr/bin/env cython

TypeError: C variable gensim.models.word2vec_inner.scopy has wrong signature (expected __pyx_t_6gensim_6models_14word2vec_inner_scopy_ptr, got pyx_t_14poincare_glove_6gensim_6models_14word2vec_inner_scopy_ptr) Evaluating model from ../models/glove/glove_baseline/glove_ep50_size100_lr0.05_vocab200000_vanilla_OPTadagrad_COOCCFUNClog_bias Traceback (most recent call last): File "glove_code/scripts/glove_main.py", line 4, in import gensim File "/home/usr/Work/poincare_glove/poincare_glove/gensim/init.py", line 5, in from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401 File "/home/usr/Work/poincare_glove/poincare_glove/gensim/models/init__.py", line 15, in from .doc2vec import Doc2Vec # noqa:F401 File "/home/usr/Work/poincare_glove/poincare_glove/gensim/models/doc2vec.py", line 78, in from gensim.models.doc2vec_inner import train_document_dbow, train_document_dm, train_document_dm_concat File "gensim/models/doc2vec_inner.pyx", line 1, in init gensim.models.doc2vec_inner

!/usr/bin/env cython

TypeError: C variable gensim.models.word2vec_inner.scopy has wrong signature (expected __pyx_t_6gensim_6models_14word2vec_inner_scopy_ptr, got __pyx_t_14poincare_glove_6gensim_6models_14word2vec_inner_scopy_ptr)

When I compiled the Cython files, there were also some errors:

/home/usr/anaconda3/envs/glove/lib/python3.6/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/usr/Work/poincare_glove/poincare_glove/glove_code/src/glove_inner.pxd tree = Parsing.p_module(s, pxd, full_module_name) warning: src/glove_inner.pyx:582:16: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.

Could you please let me know how to resolve this issue? Thanks!

Royeqiu commented 5 years ago

I met the same problem in the same situation. My problem is caused by I install two different versions of gensim. I uninstall all of them and reinstall the newest version then it works. Hope this helps you.

snooker-player commented 5 years ago

I met the same problem in the same situation. My problem is caused by I install two different versions of gensim. I uninstall all of them and reinstall the newest version then it works. Hope this helps you.

I have solved this problem. Thank you.