Ubuntu22.04 pytorch-geometric(PyG)安装

默认已经安装好了pytorch,如果没安装好,可参考博客:

pytorch库安装-CSDN博客icon-default.png?t=N7T8https://blog.csdn.net/qq_44362147/article/details/140346488?spm=1001.2014.3001.5501

pytorch版本>=1.13可以直接通过pip一步安装

pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+${CUDA}.html

以pytorch=2.0.0  cuda=11.8为例,pip命令:

pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu118.html

${CUDA} 根据cuda版本修改为cu118。

torch2.0支持的cuda或cpu版本

torch1.13支持的cuda或cpu版本

 其他Pytorch版本

需要先安装官网给出的五个包,然后在安装pytorch_geometric。

首先在 https://data.pyg.org/whl/ 中下载轮子,找到你的torch和cuda版本。以torch1.12.1+cuda116为例。

pt为pytorch版本,cu为cuda版本,cp为虚拟环境中python版本,linux操作系统。

进入你的虚拟环境:

conda activate 虚拟环境名字

pip安装:

pip install 下载路径

例如:

pip install /home/guest/torch_cluster-1.6.0+pt112cu116-cp310-cp310-linux_x86_64.whl
pip install /home/guest/pyg_lib-0.2.0+pt112cu116-cp310-cp310-linux_x86_64.whl
pip install /home/guest/torch_scatter-2.1.0+pt112cu116-cp310-cp310-linux_x86_64.whl
pip install /home/guest/torch_sparse-0.6.16+pt112cu116-cp310-cp310-linux_x86_64.whl
pip install /home/guest/torch_spline_conv-1.2.1+pt112cu116-cp310-cp310-linux_x86_64.whl

所有安装包全部安装完成后:

pip install torch-geometric

官方网址:

pyg-team/pytorch_geometric: Graph Neural Network Library for PyTorch (github.com)

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
为了安装pytorch-geometric,您可以按照以下步骤进行操作: 1. 访问PyTorch Geometric官网,网址为:https://pytorchgeometric.readthedocs.io/en/latest/notes/installation.html [1。 2. 根据您的PyTorch版本和CUDA版本,选择相应的命令进行安装。比如,如果您使用的是PyTorch 1.7.0和CUDA 11.0,可以使用以下命令进行安装: ``` pip install torch-scatter==latest cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-sparse==latest cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-cluster==latest cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-spline-conv==latest cu110 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-geometric ``` [2] 3. 如果您使用的是PyTorch 1.6.0和CUDA 10.2,可以使用以下命令进行安装: ``` 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 ``` [3] 请根据您的PyTorch和CUDA版本选择适当的命令进行安装。希望对您有帮助!123 #### 引用[.reference_title] - *1* [PyTorch Geometric安装](https://blog.csdn.net/weixin_51736742/article/details/119379079)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] - *2* *3* [如何安装pytorch_geometric库](https://blog.csdn.net/qq_28368377/article/details/109731397)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值