Pytorch的安装

Pytorch的安装

检查是否有合适的GPU,若有安装Cuda与CuDNN

NVIDA控制面板,帮助,系统信息,驱动程序版本 451.67(本机)

下载pytorch安装文件,进行pytorch的安装

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

#安装失败,为conda添加镜像
conda config --show-sources #查看源
​
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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    
    
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
    
    conda info 
    
    conda config --remove channels 镜像源
    
    可以去掉-c pytorch 参数“该参数表示指定下载通道”

检测安装结果

Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.9.0
>>> print(torch.version.cuda)
10.2
>>> print(torch.backends.cudnn.version())
7605
>>> print(torch.cuda.gat_device_name(0))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'torch.cuda' has no attribute 'gat_device_name'
>>> print(torch.cuda.get_device_name(0))
GeForce 940MX
>>> print(torch.cuda.is_availabel())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'torch.cuda' has no attribute 'is_availabel'

搭建DGL环境

#搭建DGL环境
conda install -c dglteam dgl #安装CPU版本
conda install -c dglteam dgl-cuda10.2 #安装CUDA10.2版本 
​
​
#卸载
conda uninstall -c dglteam dgl-cuda10.0
​
​
#安装环境后测试
import dgl
print(dgl.__version__)
​

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

算法打怪中

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值