dgl下载(torch+torchdata配套)

注:以下截图分别来自torchdata、dgl、torch的官网
先看torchdata与torch的版本适配,这边选择0.6.0版本的torchdata,那么需要对应的torch为2.0.0 pip install torchdata==0.6.0

再看dgl的版本适配

那这边需要选择的是cuda11.8,dgl cu118,然后去选取torch的cu118

# CUDA 11.8
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia


dgl下载,去轮子仓库,这边看到1.1.2+cu118和2.2.1+cu118等可用,2.2.1+cu118用不来,那就1.1.2+cu118可用。

data.dgl.ai/wheels/cu118/repo.html

pip install dgl==1.1.2+cu118 -f https://data.dgl.ai/wheels/cu118/repo.html

测试
import torch
import dgl
​
print("PyTorch version:", torch.__version__)
print("CUDA available:", torch.cuda.is_available())
print("CUDA version used by PyTorch:", torch.version.cuda)
print("GPU:", torch.cuda.get_device_name(0) if torch.cuda.is_available() else "No CUDA")
print("DGL version:", dgl.__version__)
Using device: cuda
PyTorch version: 2.0.0
CUDA available: True
CUDA version used by PyTorch: 11.8
GPU: NVIDIA GeForce RTX 4070 Laptop GPU
DGL version: 1.1.2+cu118

可以,看样子是成功了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值