学习Tensorflow,使用源码安装
PC上装好Ubuntu系统,我们一步一步来讲解如何使用源码安装tensorflow?(我的Ubuntu系统是15.10)
- 安装cuda
根据你的系统型号选择相应的cuda版本下载
https://developer.nvidia.com/cuda-downloads
我选的是cuda-repo-ubuntu1504-7-5-local_7.5-18_amd64.deb
右击下载到的文件,Open inTerminal,输入一下命令:
sudo dpkg -icuda-repo-ubuntu1504-7-5-local_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install cuda
安装到:/usr/local/cuda
下载cudnn,https://developer.nvidia.com/cudnn
我下的版本是cudnn-7.0-linux-x64-v4.0-prod.tgz
同上,输入以下命令:
tar xvzf cudnn-7.0-linux-x64-v4.0-prod.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
- 安装tensorflow
下载tensorflow源文件
git clone--recurse-submodules https://github.com/tensorflow/tensorflow
安装Bazel,Bazel是Google开源构建工具,类似于Make的工具,用来编译构建tensorflow
http://bazel.io/docs/install.html
Bazel下载地址:
https://github.com/bazelbuild/bazel/releases(bazel-0.2.2b-installer-linux-x86_64.sh)
sudo apt-get install pkg-config zip g++zlib1g-dev unzip
chmod +x bazel-version-installer-os.sh
./bazel-version-installer-os.sh --user
export PATH="$PATH:$HOME/bin"
安装tensorflow其他的依赖
sudo apt-get install python-numpy swig python-dev python-wheel
配置tensorflow,需要你指定相应文件的安装目录。cd进tensorflow源文件。
sudo ./configure
配置好,会出现以下内容:
Setting up Cuda include
Setting up Cuda lib64
Setting up Cuda bin
Setting up Cuda nvvm
Setting up CUPTI include
Setting up CUPTI lib64
Configuration finished
使用Bazel编译构建
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel-bin/tensorflow/cc/tutorials_example_trainer--use_gpu
# Lots of output. This tutorial iteratively calculates the major eigenvalue of # a 2x2 matrix, on GPU. The last few lines look like this. 000009/000005 lambda = 2.000000 x = [0.894427 -0.447214] y = [1.788854 -0.894427] 000006/000001 lambda = 2.000000 x = [0.894427 -0.447214] y = [1.788854 -0.894427] 000009/000009 lambda = 2.000000 x = [0.894427 -0.447214] y = [1.788854 -0.894427]
OK!
Test:
cd /home/lei/tensorflow/tensorflow/models/image/mnist
python convolutional.py
Tips:
- configure, gcc version <=4.9
- cudnn version = v4
参考资料:
学习Tensorflow,使用源码安装的更多相关文章
- SDN学习之RYU源码安装
近些天开始接触SDN,即软件定义网络的学习,由于是初学者,想通过写博客来分享自己对sdn学习中所使用的ryu以及mininet仿真软件. Mininet源码安装: 尽管网上对mininet的安装教程很 ...
- Ubuntu16.04系统Tensorflow源码安装
最近学习Tensorflow,记录一下安装过程.目前安装的是CPU版的 1.下载tensorflow源码 tensorflow是个开源库,在github上有源码,直接在上面下载.下载地址:https: ...
- TensorFlow源码安装
前言 TensorFlow如果能二进制包安装,我真的不想选择自己编译,但是情况不由人,好不容易找到一台服务器,CPU不支持AVX指令集,安装的release版本运行到import tensorflow ...
- mac/Linux源码安装TensorFlow
因为用pip命令直接下载安装会链接到google,导致打不开,比如使用pip install tensorflow碰到如下的问题.因此在本文中,主要介绍了如何通过源码进行TensorFlow的安装 $ ...
- [原创] zabbix学习之旅一:源码安装
zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案.zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快速定位/解决存 ...
- linux源码安装mysql,shell编程学习,ubuntu
一.mysql安装 以源码安装的方式编译和安装Mysql 5.6. 1.卸载旧版本 rpm -qa | grep mysql 检查是否有旧版本 查询结果:mysql-libs-5.1.73-7.el6 ...
- MySQL学习之路 一 : MySQL 5.7.19 源码安装
MySQL 5.7.19 源码安装 查看系统: # cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) 安装依赖包 # yum - ...
- Ubuntu16 编译源码安装MXNet 可变卷积Deformable-ConvNets GPU版
[引言]最近接手了公司的关于虫子识别的项目,使用MXNet框架开发,但是实际用的是Deformable-ConvNets. Deformable-ConvNets为微软研究研究院提出的可变卷积网络,可 ...
- mono-3.4.0 源码安装时出现的问题 [do-install] Error 2 [install-pcl-targets] Error 1 解决方法
Mono 3.4修复了很多bug,继续加强稳定性和性能(其实Mono 3.2.8 已经很稳定,性能也很好了),但是从http://download.mono-project.com/sources/m ...
随机推荐
- SPFA小总结
关于spfa 知识点 原始版 ---裸 应用: 一.判负环 两种方法 1.跑单源点bfs,如果某一个点入队了n-1次,存在 2.对于每个点dfs,如果此源点反被其他点更新,存在 证明:点i作为源点,d ...
- ubuntu 安装 WPS for Linux(ubuntu)字体配置(字体缺失解决办法)及卸载libreoffice
从官网下载安装wps for Linux sudo dpkg -i wps-office_10.1.0.5672~a21_amd64.deb 启动WPS for Linux后,出现提示"系统 ...
- Java面试题—初级(8)
基本表结构: student(sno,sname,sage,ssex)学生表 course(cno,cname,tno) 课程表 sc(sno,cno,score) 成绩 ...
- Map 探索
关于Map问题我一直了解的不是很透彻,下面进行比较系统的总结一下. 1.
- 【Git】Git工具常用命令
GitHub使用指南 一.把本地代码上传到GitHub 0. 提前配置好上传地址 [git config --global user.name "username"] [git c ...
- Jenkins简明入门(二) -- 利用Jenkins完成Python程序的build、test、deployment
大家可能还没搞清楚,Jenkins到底能做什么? 本节内容利用Jenkins完成python程序的build.test.deployment,让大家对Jenkins能做的事情有一个直观的了解. 本节内 ...
- selenium登录163邮箱
环境:windows8 python2.7+selenium+chrome 直接上脚本: # coding=utf-8from selenium import webdriverimport tim ...
- 西安电话面试:谈谈Vue数据双向绑定原理,看看你的回答能打几分
最近我参加了一次来自西安的电话面试(第二轮,技术面),是大厂还是小作坊我在这里按下不表,先来说说这次电面给我留下印象较深的几道面试题,这次先来谈谈Vue的数据双向绑定原理. 情景再现: 当我手机铃声响 ...
- UML总结4---UML九种图关系说明
转自:http://blog.csdn.NET/chenyujing1234/article/details/8173519 UML中包括九种图:用例图.类图.对象图.状态图.时序图.协作图.活动图. ...
- ACM 畅通工程
Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇.省政府"畅通工程"的目标是使全省任何两个城镇间都可以实现交通 ...