Ubuntu16.04安装TensorFlow 1.2.0
来源:互联网 发布:大连知行中学怎么样 编辑:程序博客网 时间:2024/04/25 20:16
环境:Ubuntu16.04(64位)
Python2.7
一定要是64位系统,TensorFlow不支持32位!
参考官方的文档,我选择基于virtualenv安装,下面是步骤:
1.下载TensorFlow的whl文件,根据自己的实际环境来,我对应的是tensorflow-1.2.0rc1-cp27-cp27mu-manylinux1_x86_64.whl
2.安装必备的工具;
sudo apt-get install python-pip python-dev python-virtualenv
3.安装好以后,新建一个virtualenv环境;
virtualenv --system-site-packages ~/tensorflow #路径自己定义,我的是 ~/tensorFlowcd ~/tensorflow #进入tensorFlow目录
4.激活virtualenv环境
source bin/activate
成功执行后命令行前面多了个” (tensorflow) ”
5.安装TensorFlow
pip install numpy #我有点方,所以先装个numpypip install tensorflow-1.2.0rc1-cp27-cp27mu-manylinux1_x86_64.whl
安装tensorflow时候要保持联网,虽然这个包已经下载好了,但是他还会下载一些依赖,讲道理的说numpy也会自动下载,但是为了确保,我首先手动把他安装了。(如果你没有改pip镜像源的话,在下载依赖时候可能报错http请求超时错误,可以选择重试几次,或者直接修改你的镜像源,改成国内的,这方面网上帖子很多。我就不赘述了)。
6.完成。
声明:我最终成功的版本是在Ubuntu下新建了一个Python的virtualenv,然后在虚拟环境安装成功的。直接安装的二进制文件。所以这样安装后运行时可能会有警告
2017-05-29 13:16:36.255629: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.2017-05-29 13:16:36.256148: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.2017-05-29 13:16:36.256570: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.2017-05-29 13:16:36.256695: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.2017-05-29 13:16:36.256765: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
这是我的提示信息,’ w ‘是warning的意思,同理,’ E ‘就是error。这堆警告大概就是说我没有编译SSE、AVX、FMA(这三个都是指令集),但是我的电脑支持这些指令集,如果我编译这些指令集可以提高运行速度。网上度了一下说如果编译这些指令集的话速度可以提升近一倍。
补充:如果准备编译安装(为了使用FMA、SSE等指令集),不推荐在虚拟机中编译,或者分配资源多一些试试,我分配1.6G编译直接卡死
- Ubuntu16.04安装TensorFlow 1.2.0
- Ubuntu16.04安装tensorflow
- Ubuntu16.04 Tensorflow安装
- ubuntu16.04 安装tensorflow
- ubuntu16.04安装tensorflow
- ubuntu16.04+cuda8.0+cudnn6+tensorflow安装
- Ubuntu16.04安装TensorFlow教程
- Ubuntu16.04 安装Tensorflow-CPU
- Ubuntu16.04安装anaconda3+tensorflow
- ubuntu16.04安装tensorflow-gpu
- [TensorFlow] ubuntu16.04 pip3安装 TensorFlow
- Ubuntu16.04+gtx1060+cuda8.0+cudnn8.0+tensorflow安装
- ubuntu16.04 64位安装tensorflow+cuda8.0+cudnn7.0
- ubuntu16.04+gtx1060+cuda8.0+tensorflow源码安装、测试经历
- ubuntu16.04下cuda8.0+cudnn5.1+tensorflow安装
- Ubuntu16.04下安装CUDA8.0和tensorflow
- ubuntu16.04+cuda8.0+cudnn5.1.10+tensorflow(pip安装)
- Ubuntu16.04+Tensorflow+CUDA8.0
- 移动web前端(即:webapp)开发之常见bug解决
- StringUtils部分方法
- Flume1.7.0用户手册(一)
- Unity实现虚拟摇杆
- Android 进阶8:进程通信之 Binder 机制浅析
- Ubuntu16.04安装TensorFlow 1.2.0
- bzoj3196Tyvj 1730 二逼平衡树
- 关于eclipse无法执行java程序的解决方法
- DICOM医学图像读取涉及到的医学坐标体系
- ROS: 安装数据包
- rand.nextInt(n)和rand.nextFloat(n)
- 策略模式
- 利用Github Pages和Hexo搭建个人博客
- Codeforces 802A Heidi and Library (easy) 题解