Ubuntu20安装torch1.13和pytorch_geometric2.3.0(对应cuda11.6)

pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu116

  • 安装torch2.3.0 https://pytorch-geometric.readthedocs.io/en/2.3.0/install/installation.html,我的python版本3.8符合,pytorch1.13.0,cuda11.6
  • 首先安装对应库,参考官方版本
    pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.13.0+cu116.html
  • 有个小问题,安装到torch_cluster就不动了,一直在Building wheel for torch_cluster (setup.py) ...打转,选择手动安装,在这下载对应包https://data.pyg.org/whl/torch-1.13.0+cu116.html,搜索torch_cluster,选择cp38我是python38复制对应链接
    wget https://data.pyg.org/whl/torch-1.13.0%2Bcu116/torch_cluster-1.6.0%2Bpt113cu116-cp38-cp38-linux_x86_64.whl
    pip install torch_cluster-1.6.0+pt113cu116-cp38-cp38-linux_x86_64.whl
  • 可能之前依赖问题,运行时候出错UserWarning: An issue occurred while importing 'pyg-lib'. 可以卸载再重新安装,推荐还是一个库一个库安装
    pip install pyg_lib -f https://data.pyg.org/whl/torch-1.13.0+cu116.html
  • 指定版本号安装torch_geometric==2.3.0
    pip install torch_geometric==2.3.0 -f https://data.pyg.org/whl/torch-1.13.0+cu116.html
  • 起因:之前版本是torch_geometric2.0.4,使用GAT报错ImportError: cannot import name 'DenseGATConv' from 'torch_geometric.nn',查了一下文档在2.3.0才引入这个函数https://readthedocs.org/projects/pytorch-geometric/,还得把nvidia-smi升级到535
相关推荐
console.log('npc')1 小时前
Python 学习教程 · 第4课:数据结构
数据结构·python·学习
honker_X1 小时前
Python字符串全攻略:从入门到精通
开发语言·python
贾公子1 小时前
异步检测的轮询与超时——别把「还没好」当成「失败了」
后端·python
吃我一窝jio1 小时前
Docker+Jenkins+K8s全流程部署
java·开发语言·笔记·python
欢乐马87912 小时前
优化|MPSolver 和 pywraplp 到底谁是谁?一次讲清 OR-Tools 的三层结构
python
mengge.cloud4 小时前
Python基础保姆级!从入门到入土
开发语言·python·云原生·pygame
qq_158895411118 小时前
Suno-API 是什么?官方 V6 模型与 Python / TypeScript 接入指南
python·ai音乐·suno api
学无止境小袁同学18 小时前
Google ADK 学习指南
python·llm·agent·多agent·google adk·llmagent·agent cli
郝学胜-神的一滴19 小时前
Effective Python 条款35:用类封装替代生成器异常注入
开发语言·人工智能·python·金融·pandas·scikit-learn·matplotlib
LK_0719 小时前
【力扣】142. 环形链表 II |Python
python·leetcode·链表