iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 7
0
AI & Machine Learning

tensorflow python系列 第 7

DAY7 ubuntu於本機安裝GPU版Tensorflow (下)

前言:

於昨天的文章中 ,我們已經完成了GPU版Tensorflow的安裝的大半了,剩下的部份,我將在今天安裝完成,並且簡單的測試是否安裝成功。

安裝:

安裝:

$ sudo pip3 install --upgrade tensorflow-gpu

The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: tensorflow-gpu in ./.local/lib/python3.5/site-packages
Requirement already up-to-date: wheel>=0.26 in ./.local/lib/python3.5/site-packages (from tensorflow-gpu)
Requirement already up-to-date: protobuf>=3.3.0 in /usr/local/lib/python3.5/dist-packages (from tensorflow-gpu)
Requirement already up-to-date: six>=1.10.0 in ./.local/lib/python3.5/site-packages (from tensorflow-gpu)
Requirement already up-to-date: enum34>=1.1.6 in ./.local/lib/python3.5/site-packages (from tensorflow-gpu)
Requirement already up-to-date: tensorflow-tensorboard<0.5.0,>=0.4.0rc1 in ./.local/lib/python3.5/site-packages (from tensorflow-gpu)
Requirement already up-to-date: numpy>=1.12.1 in ./.local/lib/python3.5/site-packages (from tensorflow-gpu)
Collecting setuptools (from protobuf>=3.3.0->tensorflow-gpu)
  Downloading setuptools-38.2.5-py2.py3-none-any.whl (489kB)
    100% |████████████████████████████████| 491kB 1.7MB/s 
Requirement already up-to-date: markdown>=2.6.8 in ./.local/lib/python3.5/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu)
Requirement already up-to-date: html5lib==0.9999999 in ./.local/lib/python3.5/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu)
Requirement already up-to-date: werkzeug>=0.11.10 in ./.local/lib/python3.5/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu)
Requirement already up-to-date: bleach==1.5.0 in ./.local/lib/python3.5/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu)
Installing collected packages: setuptools
  Found existing installation: setuptools 38.2.4
    Uninstalling setuptools-38.2.4:
      Successfully uninstalled setuptools-38.2.4
Successfully installed setuptools-38.2.5

到這邊tensorflow就差不多安裝完成了

遇到錯誤時:

(1)執行時,他說少了_tkinter這個Module

解決:

$ sudo pip3 install python3-tk
(2)當以上安裝完成後 執行仍有錯誤時

$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64/
/usr/local/cuda/lib64/(安裝時所設之目錄)
以上這行指令,有時重開機時皆需要輸入

網路上教學為

$ cd home/user
$ vim .bashrc

於.bashrc中新增(export LD_LIBRARY_PATH=/usr/local/cuda/lib64/)這行 往後重新啟動仍然抓的到了

測試是否安裝成功:

新增檔案:

https://ithelp.ithome.com.tw/upload/images/20180116/20107535FAo3P1Vp78.png

執行檔案:

https://ithelp.ithome.com.tw/upload/images/20180116/20107535KM7U0AXCT5.png
跳出表示安裝成功

碎碎唸時間:

今天一整個下午再處理期末小專題,這學期的課程都很累又沒啥內容,害我整個人都懶洋洋的,希望下學期的課程有趣一些,也希望這學期可以順利all pass。


上一篇
DAY6 ubuntu於本機安裝GPU版Tensorflow (上)
下一篇
DAY8 ubuntu於Docker安裝tensorflow
系列文
tensorflow python30

尚未有邦友留言

立即登入留言