基于 Anaconda 安装 tensorflow
2016-07-18 15:10
447 查看
基于 Anaconda 安装 tensorflow
Anaconda 是一个集成许多第三方科学计算库的 Python 科学计算环境,Anaconda 使用 conda 作为自己的包管理工具,同时具有自己的计算环境,类似 Virtualenv.和 Virtualenv 一样,不同 Python 工程需要的依赖包,conda 将他们存储在不同的地方。 TensorFlow 上安装的 Anaconda 不会对之前安装的 Python 包进行覆盖.
安装 Anaconda
建立一个 conda 计算环境
激活环境,使用 conda 安装 TensorFlow
安装成功后,每次使用 TensorFlow 的时候需要激活 conda 环境
安装 Anaconda :
参考 Anaconda 的下载页面的指导
建立一个 conda 计算环境名字叫tensorflow:
# Python 2.7 $ conda create -n tensorflow python=2.7 # Python 3.4 $ conda create -n tensorflow python=3.4
激活tensorflow环境,然后使用其中的 pip 安装 TensorFlow. 当使用easy_install使用–ignore-installed标记防止错误的产生。
$ source activate tensorflow (tensorflow)$ # Your prompt should change # Ubuntu/Linux 64-bit, CPU only, Python 2.7: (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7. Requires CUDA toolkit 7.5 and CuDNN v4. # For other versions, see "Install from sources" below. (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl # Mac OS X, CPU only: (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py2-none-any.whl 对于 Python 3.x : $ source activate tensorflow (tensorflow)$ # Your prompt should change # Ubuntu/Linux 64-bit, CPU only, Python 3.4: (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4. Requires CUDA toolkit 7.5 and CuDNN v4. # For other versions, see "Install from sources" below. (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl # Mac OS X, CPU only: (tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py3-none-any.whl
conda 环境激活后,你可以测试
当你不用 TensorFlow 的时候,关闭环境:
(tensorflow)$ source deactivate $ # Your prompt should change back
再次使用的时候再激活 :-)
$ source activate tensorflow (tensorflow)$ # Your prompt should change. # Run Python programs that use TensorFlow. ... # When you are done using TensorFlow, deactivate the environment. (tensorflow)$ source deactivate
相关文章推荐
- Ubuntu下如何安装TensorFlow
- TensorFlow 模型保存/载入的两种方法
- 在windows 上安装tensorflow
- 新手上手Tensorflow之手写数字识别应用(2)
- module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6问题解决
- Tensorflow protobuf版本报错问题解决(AttributeError: 'module' object has no attribute 'Default')
- 观点:深度学习,先跟上再说
- Tensorflow 填坑日记
- 深度学习库(排名总结)
- (tensorflow之十二)tensorflow与numpy函数的选择(以reshape为例)
- (tensorflow之二十)TensorFlow Eager Execution立即执行插件
- TensorFlow实用编程
- tensorflow对比AlexNet的CPU和GPU运算效率
- 读tensorflow实战之ResNet_V2
- jvm 内存结构
- [JavaWeb]解决doGet()获取数据的乱码问题
- [JavaWeb]解决doGet()获取数据的乱码问题
- 【HDU5721 BestCoder 2nd AnniversaryD】【平面最近点对 分治写法+KD-tree写法】Palace 平面最近点对
- jzoj 1401. 【2012.03.09普及组】约数和
- 圆角图片工具类