ubuntu18.04配置python中的tensorflow-gpu环境

5 篇文章 0 订阅
2 篇文章 0 订阅

换了系统之后需要重新配备python的环境,我的电脑系统是ubuntu18.04,GPU10.1版本,打算装3.6版本的python。

搜索tensorflow版本
conda search tensorflow
查看安装源
conda config --show channels
添加清华源
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
安装tensorflow
 conda install tensorflow-gpu==1.14

相应的cuda和cudnn版本是: cudatoolkit=10.1.243 , cudnn=7.6.5 ,在安装tensorflow时,这两个库会默认被安装,需要注意看更新的软件包,尤其是python的版本。

在电脑软件与更新上修改附加驱动驱动版本到435版本
安装pytorch

进入官网https://pytorch.org/
选择安装命令并加上清华源:

pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f 
https://download.pytorch.org/whl/torch_stable.html 
 -i  https://pypi.tuna.tsinghua.edu.cn/simple some-package

大概有7百多兆,网好的话一会就下完了, 通过输入以下语句进行测试

import torch
torch.cuda.is_available()

结果是True就表示安装成功了。

end
参考来源
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值