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
相关推荐
alvin_200514 分钟前
python之OpenGL应用(二)Hello Triangle
python·opengl
铁蛋AI编程实战22 分钟前
通义千问 3.5 Turbo GGUF 量化版本地部署教程:4G 显存即可运行,数据永不泄露
java·人工智能·python
jiang_changsheng34 分钟前
RTX 2080 Ti魔改22GB显卡的最优解ComfyUI教程
python·comfyui
0思必得01 小时前
[Web自动化] Selenium处理滚动条
前端·爬虫·python·selenium·自动化
子榆.1 小时前
CANN 与主流 AI 框架集成:从 PyTorch/TensorFlow 到高效推理的无缝迁移指南
人工智能·pytorch·tensorflow
沈浩(种子思维作者)1 小时前
系统要活起来就必须开放包容去中心化
人工智能·python·flask·量子计算
2301_790300962 小时前
Python数据库操作:SQLAlchemy ORM指南
jvm·数据库·python
m0_736919102 小时前
用Pandas处理时间序列数据(Time Series)
jvm·数据库·python
getapi2 小时前
实时音视频传输与屏幕共享(投屏)
python
java干货2 小时前
为什么 “File 10“ 排在 “File 2“ 前面?解决文件名排序的终极算法:自然排序
开发语言·python·算法