conda 安装 tensorflow-gpu

一. 背景

今天尝试在conda创建的虚拟环境里安装tensorflow,使用如下代码进行安装

pip install tensorflow

但是会报错,如下:

$ pip install tensorflow
Downloading/unpacking tensorflow
  Could not find any downloads that satisfy the requirement tensorflow
Cleaning up...
No distributions at all found for tensorflow

二. 解决方案

后来找了很多资料,发现可以直接用Anconda直接安装,并且实现并不需要预先知道tensorflow的路径。

1. 加载虚拟环境

source activate venv

2. 使用conda查询可安装包

(venv)$ anaconda search -t conda tensorflow-gpu
Using Anaconda API: https://api.anaconda.org
Packages:
     Name                      |  Version | Package Types   | Platforms       | 
     ------------------------- |   ------ | --------------- | --------------- | 
     HCC/tensorflow-gpu        |    1.7.0 | conda           | linux-64        | 
     aaronzs/tensorflow-gpu    |   1.10.0 | conda           | linux-64, win-64 | 
     acaprez/tensorflow-gpu    |    1.5.0 | conda           | linux-64        | 
.
.
.
.(这里其实还有很多,就不贴出来了)
machine learning.
variant.
Found 23 packages

Run 'anaconda show <USER/PACKAGE>' to get installation details

3. 使用anaconda查看安装路径

anaconda show aaronzs/tensorflow-gpu

Using Anaconda API: https://api.anaconda.org
Name:    tensorflow-gpu
Summary: TensorFlow helps the tensors flow
Access:  public
Package Types:  conda
Versions:
   + 1.3.0
   + 1.4.0rc1
   + 1.4.0
   + 1.5.0
   + 1.6.0
   + 1.7.0
   + 1.8.0
   + 1.7.1
   + 1.9.0
   + 1.10.0

To install this package with conda run:
     conda install --channel https://conda.anaconda.org/aaronzs tensorflow-gpu

4. 进行安装

conda install --channel https://conda.anaconda.org/aaronzs tensorflow-gpu=1.10.0

三. 参考资料

1. anaconda安装tensorflow

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值