安装Tensorflow-gpu

安装Tensorflow-gpu最主要的问题有2个:

  1. 访问国外的anaconda网站太慢

  2. 经常出现cuda相关dll不对的情况
    现在已经有了好的安装方法:

  3. 安装anaconda。可以在镜像网站找到合适的安装包,我访问的是https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/,选择的安装包是Anaconda2-5.2.0-Windows-x86_64.exe(https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda2-5.2.0-Windows-x86_64.exe)

  4. 打开cmd窗口,创建环境。 conda create -n tensorflow-gpu python=3.6

  5. 激活建立的环境:conda activate tensorflow-gpu

  6. 输入以下命令:
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    conda config --set show_channel_urls yes
    conda install tensorflow-gpu==2.1.0

  7. 安装需要比较长的时间,因为有几个超过100M的包。

  8. 安装成功后,可以输入python,并输入import tensorflow as tf 。如果没有出现报错,那么恭喜

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值