TensorFlow学习笔记(一补):使用Anaconda安装TensorFlow

TensorFlow学习笔记(一补):使用Anaconda安装TensorFlow

最近,tensorflow网站上给出了新的使用Anaconda配置和安装Tensorflow的步骤,经过测试,在国内可以无障碍的访问。Anaconda 是一个基于Python的科学计算包集合,目前支持Python 2.7和3.5。注意:在安装过程中如果出现很长的报错,观察错误信息的末尾,如果是网络链接相关,就重新运行一遍语句即可(如出现进度条不动的情况,也可重新运行语句),Anaconda自身约500M,tensorflow所需软件包约几十M。操作系统: Ubuntu 14.04 1. 安装Anaconda

从anaconda官网(https://www.continuum.io/downloads)上下载Linux版本的安装文件(推荐Python 2.7版本),运行sh完成安装。

2. 建立一个tensorflow的运行环境

[plain] view plain copy # Python 2.7 $ conda create -n tensorflow python=2.7 # Python 3.4 $ conda create -n tensorflow python=3.4 # Python 3.5 $ conda create -n tensorflow python=3.5 3.在conda环境中安装tensorflow 在conda环境中安装tensorflow的好处是可以便捷的管理tensorflow的依赖包。分为两个步骤:激活上一步建立的名

为tensorflow的conda环境;用conda或者pip工具安装Tensorflow,作者选择的是pip方式。 3.1 pip方式

pip方式需要首先激活conda环境

[plain] view plain copy $ source activate tensorflow

然后根据要安装的不同tensorflow版本选择对应的一条环境变量设置export语句(操作系统,Python版本,CPU版本还是CPU+GPU版本)

[plain] view plain copy # Ubuntu/Linux 64-bit, CPU only, Python 2.7 (tensorflow)$ export

TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 # Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see \ (tensorflow)$ export

TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl # Mac OS X, CPU only, Python 2.7: (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/

mac/cpu/tensorflow-0.10.0-py2-none-any.whl # Mac OS X, GPU enabled, Python 2.7: (tensorflow)$ export

TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0-py2-none-any.whl # Ubuntu/Linux 64-bit, CPU only, Python 3.4 (tensorflow)$ export

TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp34-cp34m-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 # Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see \ (tensorflow)$ export

TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp34-cp34m-linux_x86_64.whl # Ubuntu/Linux 64-bit, CPU only, Python 3.5 (tensorflow)$ export

TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp35-cp35m-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 # Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see \ (tensorflow)$ export

TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp35-cp35m-linux_x86_64.whl

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4