AttributeError: module 'tensorflow.models.embedding.gen_word2vec' has no attribute 'skipgram_word2vec'

青春壹個敷衍的年華 提交于 2019-12-21 22:05:30

问题


I am new to Tensorflow and I am running the tutorial of word2vec embedding code (https://github.com/tensorflow/models/tree/master/tutorials/embedding) on Tensorflow (cpu-only), OS X: 10.11.6. I installed tensorflow via pip install.

Running word2vec_basic.py can reach the expected result, but when it turns to word2vec.py and word2vec_optimized.py, the following error is displayed:


回答1:


You'll need to use bazel to build the directory, since the op 'skipgram_word2vec' is defined in C++ and not in Python.



来源:https://stackoverflow.com/questions/41229308/attributeerror-module-tensorflow-models-embedding-gen-word2vec-has-no-attribu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!