I have been trying to train a word2vec model on CentOS (6.5) (has python 2.6.6) using gensim. This is the warning message I have been receiving:
Training embedding model... /usr/lib64/python2.6/site-packages/gensim/models/word2vec.py:651: UserWarning: C extension not loaded for Word2Vec, training will be slow. Install a C compiler and reinstall gensim for fast training.
warnings.warn("C extension not loaded for Word2Vec, training will be slow. "
I do have gcc installed:
$ gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
$ which gcc /usr/bin/gcc
$ which g++ /usr/bin/g++
I also tried uninstall then reinstall gensim, but it still shows the same warning message that C extension was not loaded and training will be slow...
Does anyone have any idea what causes this and what should I do?? Thanks!!
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ which gcc
/usr/bin/gcc--
You received this message because you are subscribed to a topic in the Google Groups "gensim" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gensim/isBqIhrw9mk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gensim+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
$ cython word2vec_inner.pyx
$ cython doc2vec_inner.pyx
Compiler crash traceback from this point on:
File "Cython/Compiler/Visitor.py", line 173, in Cython.Compiler.Visitor.TreeVisitor._visit (/tmp/pip_build_root/cython/Cython/Compiler/Visitor.c:4469)
return handler_method(obj)
File "Cython/Compiler/Visitor.py", line 508, in Cython.Compiler.Visitor.MethodDispatcherTransform.visit_BinopNode (/tmp/pip_build_root/cython/Cython/Compiler/Visitor.c:10624)
return self._visit_binop_node(node)
File "Cython/Compiler/Visitor.py", line 519, in Cython.Compiler.Visitor.MethodDispatcherTransform._visit_binop_node (/tmp/pip_build_root/cython/Cython/Compiler/Visitor.c:10802)
if obj_type.is_builtin_type:
AttributeError: 'NoneType' object has no attribute 'is_builtin_type'
pip install cython