TensorFlow:修订间差异
来自Ubuntu中文
跳到导航跳到搜索
小无编辑摘要 |
|||
(未显示同一用户的8个中间版本) | |||
第1行: | 第1行: | ||
== 安装 == | == 安装 == | ||
系统 ubuntu 16.04 amd64 | |||
=== 安装 pip3 === | |||
这里选择 python 3 作为开发环境 | |||
sudo apt-get install python-dev build-essential | |||
sudo apt-get install -y python3-pip | |||
sudo pip3 install --upgrade pip | |||
sudo mv /usr/bin/pip3 /usr/bin/pip3.bak | |||
sudo ln -s /usr/local/bin/pip3 /usr/bin/ | |||
下面安装过程中,如果有 nvidia GPU 显卡,安装 gpu 版本,否则安装 cpu 版本。 | |||
=== 安装CPU版本 === | |||
sudo pip3 install tensorflow | |||
=== 安装GPU版本 === | |||
==== 安装 tensorflow gpu 版本 ==== | |||
sudo pip3 install tensorflow-gpu | |||
sudo pip3 install gunicorn flask image | |||
==== 加入 显卡 ppa 源 ==== | |||
sudo apt-get install software-properties-common | |||
sudo add-apt-repository ppa:graphics-drivers/ppa | |||
sudo apt update | |||
==== 安装 Nvidia Toolkit 8.0 ==== | |||
来源: https://developer.nvidia.com/cuda-toolkit | |||
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb | |||
sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb | |||
sudo apt-get update | |||
sudo apt-get install cuda | |||
==== 安装 CudNN ==== | |||
来源: https://developer.nvidia.com/cudnn 需要注册和下载 | |||
下载: https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v5.1/prod_20161129/8.0/libcudnn5_5.1.10-1+cuda8.0_amd64-deb | |||
sudo dpkg -i libcudnn5_5.1.10-1+cuda8.0_amd64-deb | |||
==== 设置环境变量 ==== | |||
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"' >> .bashrc | |||
echo 'export CUDA_HOME=/usr/local/cuda' >> .bashrc | |||
source ~/.bashrc | |||
==== 查看显卡信息 ==== | |||
nvidia-smi | |||
== 参考链接 == | == 参考链接 == | ||
第10行: | 第51行: | ||
http://blog.topspeedsnail.com/archives/10858 | http://blog.topspeedsnail.com/archives/10858 | ||
http://blog.topspeedsnail.com/archives/10897 | http://blog.topspeedsnail.com/archives/10897 |
2017年6月15日 (四) 15:13的最新版本
安装
系统 ubuntu 16.04 amd64
安装 pip3
这里选择 python 3 作为开发环境
sudo apt-get install python-dev build-essential sudo apt-get install -y python3-pip sudo pip3 install --upgrade pip sudo mv /usr/bin/pip3 /usr/bin/pip3.bak sudo ln -s /usr/local/bin/pip3 /usr/bin/
下面安装过程中,如果有 nvidia GPU 显卡,安装 gpu 版本,否则安装 cpu 版本。
安装CPU版本
sudo pip3 install tensorflow
安装GPU版本
安装 tensorflow gpu 版本
sudo pip3 install tensorflow-gpu sudo pip3 install gunicorn flask image
加入 显卡 ppa 源
sudo apt-get install software-properties-common sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update
安装 Nvidia Toolkit 8.0
来源: https://developer.nvidia.com/cuda-toolkit
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb sudo apt-get update sudo apt-get install cuda
安装 CudNN
来源: https://developer.nvidia.com/cudnn 需要注册和下载
sudo dpkg -i libcudnn5_5.1.10-1+cuda8.0_amd64-deb
设置环境变量
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"' >> .bashrc echo 'export CUDA_HOME=/usr/local/cuda' >> .bashrc source ~/.bashrc
查看显卡信息
nvidia-smi
参考链接
http://wiki.jikexueyuan.com/project/tensorflow-zh/tutorials/mnist_beginners.html