Linux下安装 torch_geometirc

本文指导如何在Linux操作系统中正确安装torch_geometric库,强调了pytorch、cuda版本匹配的重要性,并提供了一步步的安装步骤,包括检查现有pytorch和cuda版本,以及根据版本信息输入相应的安装命令。
摘要由CSDN通过智能技术生成

1、查看已安装的pytorch版本

import torch
print(torch.__version__)

2、查看安装的torch对应的cuda版本

>>> print(torch.version.cuda)

3、查看已安装的cuda版本

$nvcc --version

4、23步的版本要一致(重要
5、依次输入以下命令

$ pip install torch-scatter==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-sparse==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-cluster==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-spline-conv==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
$ pip install torch-geometric

这里注意修改为自己对应的cuda版本和torch版本,如cuda10.1,torch1.5.0要改为
pip install torch-scatter==latest+cu101 -f https://pytorch-geometric.com/whl/torch-1.5.0.html
6、最后测试

import torch_geometric

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值