tensorflow环境安装和指定镜像

 GPU环境配置

  • 安装tensorflow

1.下载Anaconda并安装, https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda2-4.4.0-Linux-x86_64.sh

2.增加清华大学开源软件镜像站Anaconda仓库的镜像,提高package安装效率,运行以下命令:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.4.0 cudatoolkit==8.0

conda install -c https://pypi.tuna.tsinghua.edu.cn/simple tensorflow


conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels http://mirrors.aliyun.com/pypi/simple/
conda config --set show_channel_urls yes

3.创建python2.7+tf_1.2.1版本,执行命令:
conda create --name python2.7_tf_1.2.1 python=2.7
激活环境,source activate python2.7_tf_1.2.1(退出环境,source deactivate python2.7_tf_1.2.1)
conda install tensorflow-gpu=1.2.1(想要其他版本,执行conda search tensorflow,找到对应版本安装即可)

conda install -c https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
安装完,测试一下。
$ python
>>> from tensorflow.python.client import device_lib
>>> print device_lib.list_local_devices()
[name: "/cpu:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 9675741273569321173
, name: "/gpu:0"
device_type: "GPU"
memory_limit: 11332668621
locality {
bus_id: 1
}
incarnation: 7807115828340118187
physical_device_desc: "device: 0, name: Tesla K80, pci bus id: 0000:00:04.0"
]

4.创建python3.6+tf_1.2.1版本,执行类似命令:
conda create --name python3.6_tf_1.2.1 python=3.6
激活环境,source activate python3.6_tf_1.2.1
conda install tensorflow-gpu=1.2.1
安装完,测试一下。

5.参考资料:
(1)https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
(2)http://www.jianshu.com/p/2f3be7781451
(3)https://tensorflow.feisky.xyz/install/gpu.html

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值