ubuntu14.04_64位安装tensorflow-gpu
第一步(可直接跳到第二步):安装nvidia显卡驱动
linux用户可以通过官方ppa解决安装GPU驱动的问题。使用如下命令添加Graphic Drivers PPA:
sudo add-apt-repository ppa:graphics-drivers/ppa
然后更新源:
sudo apt-get update
然后去navidia官网查看最新的驱动版本号:navidia官网:http://www.geforce.cn/drivers
比如说驱动的最新版本号为396,则执行如下指令:
sudo apt-get install nvidia-396
最后安装openGL支持:
sudo apt-get install mesa-common-dev
第二步:安装cuda-8.0(中间会默认安装显卡驱动)
$ sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb
$ sudo apt-get update
$ sudo apt-get install cuda
这时在/usr/local目录下产生一个cuda安装的路径叫"cuda-8.0"添加cuda到环境变量:
sudo vim /etc/profile
添加内容:
export CUDA_HOME=/usr/local/cuda-8.0
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
source /etc/profile
$ nvidia-smi
第三步:降低gcc版本到5.0以下
$ gcc --help
$ gcc --version #查看gcc版本号
最后一行为 <file:///usr/share/doc/gcc-4.8/README.Bugs>. 使用的ubuntu14.04使用的是4.8版本 所以不用降低gcc版本
第四步:下载 cuDNN V5+ 库文件并添加到cuda-8.0库
解压并将内容copy到/usr/local/cuda-8.0/include和lib64目录中:
cudann-8.0是目前为止比较稳定的版本在更新tensorflow后(1.4.1- 指令: pip install --upgrade tensorflow-gpu 即可更新tensorflow)
在官网下载对应版本的*.tgz文件。
指令如下:
第五步:安装tensorflow
(1)Anaconda安装tensorflow
下载:Anaconda2-4.3.1-Linux-x86_64.sh(https://repo.continuum.io/archive/)参考网址:https://www.cnblogs.com/willnote/p/6746499.html
bash Anaconda2-4.3.1-Linux-x86_64.sh
Anaconda仓库镜像
官方下载更新工具包的速度很慢,所以继续添加清华大学 TUNA提供的Anaconda仓库镜像,在终端或cmd中输入如下命令进行添加
$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
$ conda config --set show_channel_urls yes
备注:如果出现conda命令未找到,查看:https://www.cnblogs.com/chamie/p/10009193.html
Tensorflow安装
在终端或cmd中输入以下命令搜索当前可用的tensorflow版本
(可以略掉)$ anaconda search -t conda tensorflow Using Anaconda API: https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | ---------------
HCC/tensorflow | 1.0.0 | conda | linux-64
HCC/tensorflow-cpucompat | 1.0.0 | conda | linux-64
HCC/tensorflow-fma | 1.0.0 | conda | linux-64
SentientPrime/tensorflow | 0.6.0 | conda | osx-64
: TensorFlow helps the tensors flow
acellera/tensorflow-cuda | 0.12.1 | conda | linux-64
anaconda/tensorflow | 1.0.1 | conda | linux-64
anaconda/tensorflow-gpu | 1.0.1 | conda | linux-64
conda-forge/tensorflow | 1.0.0 | conda | linux-64, win-64, osx-64
: TensorFlow helps the tensors flow
creditx/tensorflow | 0.9.0 | conda | linux-64
: TensorFlow helps the tensors flow
derickl/tensorflow | 0.12.1 | conda | osx-64
dhirschfeld/tensorflow | 0.12.0rc0 | conda | win-64
dseuss/tensorflow | | conda | osx-64
guyanhua/tensorflow | 1.0.0 | conda | linux-64
ijstokes/tensorflow | 2017.03.03.1349 | conda, ipynb | linux-64
jjh_cio_testing/tensorflow | 1.0.1 | conda | linux-64
jjh_cio_testing/tensorflow-gpu | 1.0.1 | conda | linux-64
jjh_ppc64le/tensorflow | 1.0.1 | conda | linux-ppc64le
jjh_ppc64le/tensorflow-gpu | 1.0.1 | conda | linux-ppc64le
jjhelmus/tensorflow | 0.12.0rc0 | conda, pypi | linux-64, osx-64
: TensorFlow helps the tensors flow
jjhelmus/tensorflow-gpu | 1.0.1 | conda | linux-64
kevin-keraudren/tensorflow | 0.9.0 | conda | linux-64
lcls-rhel7/tensorflow | 0.12.1 | conda | linux-64
marta-sd/tensorflow | 1.0.1 | conda | linux-64
: TensorFlow helps the tensors flow
memex/tensorflow | 0.5.0 | conda | linux-64, osx-64
: TensorFlow helps the tensors flow
mhworth/tensorflow | 0.7.1 | conda | osx-64
: TensorFlow helps the tensors flow
miovision/tensorflow | 0.10.0.gpu | conda | linux-64, osx-64
msarahan/tensorflow | 1.0.0rc2 | conda | linux-64
mutirri/tensorflow | 0.10.0rc0 | conda | linux-64
mwojcikowski/tensorflow | 1.0.1 | conda | linux-64
rdonnelly/tensorflow | 0.9.0 | conda | linux-64
rdonnellyr/r-tensorflow | 0.4.0 | conda | osx-64
test_org_002/tensorflow | 0.10.0rc0 | conda |
Found 32 packages
选择一个较新的CPU或GPU版本,如jjh_cio_testing/tensorflow-gpu的1.0.1版本,输入如下命令查询安装命令
(可以略掉)$ anaconda show jjh_cio_testing/tensorflow-gpu Using Anaconda API: https://api.anaconda.org
Name: tensorflow-gpu
Summary:
Access: public
Package Types: conda
Versions:
+ 1.0.1 To install this package with conda run:
conda install --channel https://conda.anaconda.org/jjh_cio_testing tensorflow-gpu
使用最后一行的提示命令进行安装
$ conda install --channel https://conda.anaconda.org/jjh_cio_testing tensorflow-gpu==1.3.0 Fetching package metadata .............
Solving package specifications: . Package plan for installation in environment /home/will/anaconda2: The following packages will be SUPERSEDED by a higher-priority channel: tensorflow-gpu: 1.0.1-py27_4 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free --> 1.0.1-py27_4 jjh_cio_testing Proceed ([y]/n)?
conda会自动检测安装此版本的Tensorflow所依赖的库,如果你的Anaconda缺少这些依赖库,会提示你安装。因为我之前已经安装过了,所以这里只提示我安装Tensorflow。输入y并回车之后等待安装结束即可
- 可以选择次高版本的Tensorflow安装,因为最新版本可能清华 TUNA的仓库镜像库没有及时更新,而官方更新连接总是失败,我最开始选择了jjhelmus/tensorflow-gpu的1.0.1版本,其他依赖 库清华 TUNA的仓库镜像有资源,而到最后jjhelmus/tensorflow-gpu版本的Tensorflow安装包总是下载不下来,尝试20多次之后 换了一个1.0.0的版本,终于顺利安装成功
进入python,输入
import tensorflow as tf
如果没有报错说明安装成功。
(2)PIP安装tensorflow
安装完CUDA 8 和 cuDNN 5后, 在终端输入 sudo apt-get install libcupti-dev(参考:https://www.cnblogs.com/zengcv/p/6564517.html)
Ubuntu14.04默认安装的Python2.7.6
先安装Python库
sudo apt-get install python-pip python-dev
安装tensorflow:
(1)在线安装
sudo pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl
(2)下载安装(由于Ubuntu系统下,网上比较慢,可以在windows下载。推荐这种安装方法)
sudo pip install tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl
(下载地址:https://pypi.org/project/tensorflow-gpu/1.0.1/#files)
ubuntu14.04_64位安装tensorflow-gpu的更多相关文章
- ubuntu-64位安装tensorflow
(一)ubuntu-64位安装tensorflow过程: 1安装Anaconda 然后执行:bash Anaconda×××-Linux-x86_64.sh ,然后一直enter键,中途会遇到([y] ...
- 通过Anaconda在Ubuntu16.04上安装 TensorFlow(GPU版本)
一. 安装环境 Ubuntu16.04.3 LST GPU: GeForce GTX1070 Python: 3.5 CUDA Toolkit 8.0 GA1 (Sept 2016) cuDNN v6 ...
- Ubuntu在Anaconda中安装TensorFlow GPU,Keras,Pytorch
安装TensorFlow GPU pip install --ignore-installed --upgrade tensorflow-gpu 安装测试: $ source activate tf ...
- ubuntu16.04下安装TensorFlow(GPU加速)----详细图文教程【转】
本文转载自:https://blog.csdn.net/zhaoyu106/article/details/52793183 le/details/52793183 写在前面 一些废话 接触深度学习已 ...
- Windows7 64bits下安装TensorFlow GPU版本(图文详解)
不多说,直接上干货! Installing TensorFlow on Windows的官网 https://www.tensorflow.org/install/install_windows 首先 ...
- win10系统下安装TensorFlow GPU版本
首先要说,官网上的指南是最好的指南. https://www.tensorflow.org/install/install_windows 需要FQ看. 想要安装gpu版本的TensorFlow.我们 ...
- windows安装tensorflow GPU
一.安装Anaconda Anaconda是Python发行包,包含了很多Python科学计算库.它是比直接安装Python更好的选择. 二.安装Tensorflow 如果安装了tensorflow, ...
- ubuntu安装 tensorflow GPU
安装支持GPU的tensorflow前提是正确安装好了 CUDA 和 cuDNN. CUDA 和 cuDNN的安装见 Nvidia 官网和各种安装教程,应该很容易,重点是要选准了支持自己GPU的 CU ...
- win10 64位 安装TensorFlow
.由于之前安装的是python2.7 ,tensorflow在windows下必须要python3 网上查了一下有三种方法2版本共存 1.不用Anaconda windows 安装python2 与p ...
随机推荐
- java 多线程 26 : 线程池
使用线程池与不使用线程池的差别 先来看一下使用线程池与不适应线程池的差别,第一段代码是使用线程池的: public static void main(String[] args) { long sta ...
- iOS开发:一个高仿美团的团购ipad客户端的设计和实现(功能:根据拼音进行检索并展示数据,离线缓存团购数据,浏览记录与收藏记录的批量删除等)
大致花了一个月时间,利用各种空闲时间,将这个客户端实现了,在这里主要是想记录下,设计的大体思路以及实现过程中遇到的坑...... 这个项目的github地址:https://github.com/wz ...
- 解决hibernate向mysql插入中文乱码问题(转)
转载自:http://blog.csdn.net/peditable/article/details/7047573 1.首先需要修改MySQL数据库的配置文件my.ini,此文件放在mysql根目录 ...
- 迷你版mvc框架执行过程
一.把路由添加到路由表, 二.注册ControllerBuilder(老板)和默认工厂(DefaultControllerFactory) 2.1默认工厂获取可以创建的Controller. 三.由于 ...
- 【转】jsp+servlet和SSM分别是如何实现文件上传(示例)
原文地址:https://blog.csdn.net/niceliusir/article/details/78453560 以下是jsp+servlet和SSM分别是如何实现文件上传的方法示例 两种 ...
- 01_MUI之Boilerplate中:HTML5演示样例,动态组件,自己定义字体演示样例,自己定义字体演示样例,图标字体演示样例
1安装HBuilder5.0.0,安装后的界面截图例如以下: 2 依照https://www.muicss.com/docs/v1/css-js/boilerplate-html中的说明,创建上 ...
- Thinkphp CURD中的where方法
今天来给大家讲下查询最常用但也是最复杂的where方法,where方法也属于模型类的连贯操作方法之一,主要用于查询和操作条件的设置.where方法的用法是ThinkPHP查询语言的精髓,也是Think ...
- mac 系统中vim安装ctags插件
1,mac自带的ctags程序不是exuberant ctags, 所以使用时会出现问题,所以要重新安装一个: brew install exuberant ctags 安装完, which ctag ...
- nginx封ip,禁用IP段的设置说明
nginx的ngx_http_access_module 模块可以封配置内的ip或者ip段,语法如下: deny IP; deny subnet; allow IP; allow subnet; # ...
- 通过github搭建个人博客
今天突发奇想,想用GitHub搭建一个个人博客,就大概学习了一下,特此记录. 其实非常简单,首先要知道,这里是通过GitHub Pages进行搭建的,什么?不知道什么是GitHub Pages?Git ...