【问题标题】:TensorFlow fails to load runtime after installation from source从源代码安装后 TensorFlow 无法加载运行时
【发布时间】:2017-08-15 23:26:03
【问题描述】:

我开始在 Ubuntu Linux 16.06 LTS 上从源代码编译 TensorFlow,running the commands from the TensorFlow Linux compilation instructions

我的 CUDA 和 CuDNN 设置工作正常,就像预编译的 TensorFlow nvidia-docker 映像一样工作。

使用 bazel 构建 TensorFlow Python 轮子,然后用 pip 安装轮子后,尝试导入 TensorFlow 时收到以下错误消息:

>>> import tensorflow
Traceback (most recent call last):
  File "/home/james/workspace/tensorflow/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
ImportError: No module named 'tensorflow.python.pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/james/workspace/tensorflow/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/home/james/workspace/tensorflow/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/james/workspace/tensorflow/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/james/workspace/tensorflow/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
ImportError: No module named 'tensorflow.python.pywrap_tensorflow_internal'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

【问题讨论】:

    标签: python tensorflow bazel


    【解决方案1】:

    当您从 TensorFlow 源目录运行 Python 时安装了 Python 轮时会发生此错误。

    当您在安装 Python 轮盘之前尝试导入 TensorFlow 时,similar error happens

    解决此问题的方法是将您的工作目录更改为其他目录,同时仍保留在您安装 Python 轮子的 virtualenv 中。

    【讨论】:

      猜你喜欢
      • 2018-03-20
      • 2016-11-02
      • 1970-01-01
      • 1970-01-01
      • 2015-08-03
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多