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
相关推荐
SelectDB1 小时前
Apache Doris Python UDF:让 SQL 直接调用 Python 生态,支撑 Agent 时代复杂业务逻辑
大数据·数据库·python
荣码9 小时前
GraphRAG:普通RAG只能回答"点"的问题,我踩了4个坑才搞懂
java·python
金銀銅鐵20 小时前
[Python] 基于欧几里得算法,实现分数约分计算器
python·数学
Lyn_Li1 天前
Kaggle Top 5 | 198只股票、200条数据的金融预测——BattleFin高分方案从零复现
python·kaggle·比赛复盘·金融预测
小九九的爸爸1 天前
前端想要入门Agent开发,要具备哪些Python基础?
python·agent·ai编程
阿耶同学1 天前
手把手教你用 LangGraph 搭建三层嵌套 Agent 架构
python·程序员
花酒锄作田2 天前
Pydantic校验配置文件
python
hboot2 天前
AI工程师第四课 - 深度学习入门
pytorch·python·神经网络
ZhengEnCi2 天前
P2M-Matplotlib折线图完全指南-从数据可视化到趋势分析的Python绘图利器
python·matlab·数据可视化
ZhengEnCi2 天前
P2L-Matplotlib饼图完全指南-从数据可视化到图表定制的Python绘图利器
python·matlab