2017-03-22 48 views
1

我試圖安裝tensorflow,現在我堅持了以下警告:當我導入TensorFlow時,爲什麼會出現ImportError?

[email protected]:~$ python3 -c 'import tensorflow as tf; print(tf.__version__)' # for Python 3Traceback (most recent call last): 
    ... 
    File "/usr/lib/python3.5/imp.py", line 242, in load_module 
    return load_dynamic(name, filename, file) 
    File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic 
    return _load(spec) 
ImportError: libnvidia-fatbinaryloader.so.375.39: cannot open shared object file: No such file or directory 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    ... 
    File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic 
    return _load(spec) 
ImportError: libnvidia-fatbinaryloader.so.375.39: cannot open shared object file: No such file or directory 


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

您是否安裝了GPU版本?您是否安裝了所需的CUDA依賴關係? – kaufmanu

+0

@ kaufmanu是的,我安裝了GPU版本,但沒有說安裝圖形驅動程序。我這樣做是因爲安裝失敗。 – user3419211

+0

您能否在您的文章中添加更多信息您是如何準確安裝張量流和哪個版本的(例如,如果您使用夜間構建,如果您是從源代碼構建它,還是使用pip等)?另外,您是否安裝了cuDNN和CUDA工具包? – kaufmanu

回答

1

我不確定究竟是什麼導致了您報告的錯誤,但它似乎是CUDA和/或與NVIDIA卡通信的問題。另外,我不知道爲什麼在評論中提到的圖形驅動程序安裝失敗,但是如果您想要GPU支持,顯然有一個可用的圖形驅動程序是非常重要的。因此,您目前安裝的驅動程序已經正常工作,或者您將不得不找出爲什麼安裝新版本的驅動程序失敗。

你可以這樣進行:

  • 確保您的顯卡滿足要求(CUDA計算能力> = 3.0,檢查您的卡here的計算能力)。
  • 確保您安裝的cuDNN和CUDA Toolkit正常工作。爲此,您可以按照說明here(第6.2.2點)。
  • 如果這工作正常,可能只是因爲Tensorflow無法找到所需的CUDA庫。勾選此相關的帖子#1:GPU tensorflow install issue

作爲一個方面說明:您在評論中鏈接的教程似乎表明,你必須從源使用巴澤勒,這實際上並不總是需要建立Tensorflow。我建議你看看official installation instructions - 這些都非常全面,並考慮安裝所需的所有細節。所以如果全部失敗了,可以考慮從頭開始,並按照上面鏈接的官方教程。

0

我終於固定它在GNOME(CTRL + ALT + F3),並與我的帳戶登錄,然後使用: 「命令init 3」來 「須藤,我」 走到下載目錄和安裝NVIDIA驅動程序: 「噓NVIDIAxxx.run」 「重啓」

在GNOME我可以使用python3和進口tensorflow

現在的問題是,我不能登錄到以正常方式的操作系統。我仍然可以登錄gmome

相關問題