AttributeError: module 'tensorflow.models.embe

2019-04-14 05:42发布

问题:

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.