我在 MacOS 上有 Python 2.7。
我已经使用 bazel 从源代码构建了 Tensorflow,如下所示:
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
我在尝试导入 Tensorflow 包时遇到以下错误。
将张量流导入为 tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
ImportError: No module named pywrap_tensorflow_internal
使用 pip 安装后,它工作了。
$ sudo pip install /tmp/tensorflow_pkg/tensorflow-1.1.0-py2-none-any.whl
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句