2017-06-26 101 views
1

我不能打電話tensorflow提示以下錯誤:進口tensorflow錯誤

(TF) [email protected]:~$ python 
    Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
    [GCC 5.4.0 20160609] on linux2 
    Type "help", "copyright", "credits" or "license" for more information. 
    >>> import tensorflow 
    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 

    Failed to load the native TensorFlow runtime. 

我的CUDA版本是

(TF) [email protected]:~$ nvcc --version 
    nvcc: NVIDIA (R) Cuda compiler driver 
    Copyright (c) 2005-2016 NVIDIA Corporation 
    Built on Tue_Jan_10_13:22:03_CST_2017 
    Cuda compilation tools, release 8.0, V8.0.61` 

我cuDNN版本

#define CUDNN_MAJOR  5 
    #define CUDNN_MINOR  1 
    #define CUDNN_PATCHLEVEL 10 

有人可以指導我解決問題嗎?

回答

0

此問題已得到解決。 tensorflow試圖從不同位置導入軟件包。我已經通過命令卸載tensorflow,然後刪除名稱tensorflow的所有文件夾,並重新安裝新版本。現在它工作正常。