2017-04-01 140 views
2

我剛剛遵循this tutorial關於在Ubuntu 16.04上從源代碼安裝Tensorflow,對於在Nvidia圖形卡上支持完整CUDA和GPU的Python 3.5。安裝成功。Tensorflow乾淨安裝後導入錯誤

我無法在Python會話中導入Tensorflow。

這裏是終端輸出:

[email protected]:~/Downloads/tensorflow$ python3.5 
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import tensorflow 
Traceback (most recent call last): 
    File "/home/user/Downloads/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/user/Downloads/tensorflow/tensorflow/__init__.py", line 24, in <module> 
    from tensorflow.python import * 
    File "/home/user/Downloads/tensorflow/tensorflow/python/__init__.py", line 51, in <module> 
    from tensorflow.python import pywrap_tensorflow 
    File "/home/user/Downloads/tensorflow/tensorflow/python/pywrap_tensorflow.py", line 52, in <module> 
    raise ImportError(msg) 
ImportError: Traceback (most recent call last): 
    File "/home/user/Downloads/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 

for some common reasons and solutions. Include the entire stack trace 
above this error message when asking for help. 
+0

我發現這個(https://stackoverflow.com/questions/43577923/cannot-import-tensorflow-for-gpu-on-windows-10)有幫助。 – elitecho

回答

2

我發現這裏的問題,這是非常微不足道的,因此容易被忽視的原因。現在在教程中也提到了它。

我們必須簡單地進入另一個目錄,即不在所有下載文件尤其是存儲Git存儲庫的文件夾中。

我發現這個解決方案提到as a comment in a bug on Github

-1

如果您在Windows上使用TF1.2.0rc2和CUDNN 6.0,則創建一個名爲cudnn64_5.dll的cudnn64_6.dll副本即可。