pytorch 与 pytorch lightning, pytorch geometric 各个版本之间的关系

主要参考 官方的给出的意见;

1. pytorch 与 pytorch lightning 各个版本之间的关系

lightning 主要可以 适配多个版本的 torch;

https://lightning.ai/docs/pytorch/latest/versioning.html#compatibility-matrix;

2. pytorch 与 pytorch geometric 各个版本之间的关系

https://pytorch-geometric.readthedocs.io/en/2.3.1/notes/installation.html

pytorch geometric 与 torch 版本的对应关系,

则是通过左下角的 来选择当前适配的 torch 版本;

比方说当前是 PyG 2.3.1 , 则界面中显示的是 支持 Pytorch 2.0.* 以及 Pytorch 1.13.* 各个版本。

但是文中也表明最低版本的要求是 pytorch >= 1.8.0

3. 三者共同使用

官方的教程中,

有个提供了将三者集成到一起使用的

https://lightning.ai/docs/pytorch/stable/notebooks/course_UvA-DL/06-graph-neural-networks.html#Graph-level-tasks:-Graph-classification

python 复制代码
! pip install --quiet "matplotlib" "pytorch-lightning >=2.0,<2.4" "torch-sparse ==0.6.*" "torch-spline-conv ==1.2.*" "torch >=1.8.1,<2.5" "torch-cluster ==1.6.*" "torchvision" "numpy <2.0" "seaborn" "torch-scatter ==2.1.*" "torch-geometric ==2.1.*" "torchmetrics >=1.0,<1.5" "torch ==2.1.2"

由于笔者当前的环境是 torch ==1.13.1 , pytorch-lightning ==1.19.5

故先安装 torch-geometric ==2.1.* 实验一下, 因为官方的pytorch-lightning >=2.0,<2.4" 已经适配了torch-geometric ==2.1.

使用 会默认安装匹配当前 torch, 最高版本对应的 pyG

python 复制代码
conda install pyg -c pyg


conda install pyg -c pyg
Channels:
 - pyg
 - nvidia
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/respecting_god/anaconda3/envs/lightningGNN

  added / updated specs:
    - pyg


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    aiohappyeyeballs-2.4.0     |   py38h06a4308_0          19 KB
    aiohttp-3.10.5             |   py38h5eee18b_0         736 KB
    async-timeout-4.0.3        |   py38h06a4308_0          12 KB
    frozenlist-1.4.0           |   py38h5eee18b_0          52 KB
    multidict-6.0.4            |   py38h5eee18b_0          54 KB
    pyg-2.5.2                  |py38_torch_1.13.0_cu117         1.3 MB  pyg
    pyparsing-3.1.2            |   py38h06a4308_0         400 KB
    yarl-1.11.0                |   py38h5eee18b_0         148 KB
    ------------------------------------------------------------
                                           Total:         2.7 MB
相关推荐
CaracalTiger24 分钟前
什么是Clawdbot?Clawdbot下载、安装、配置教程(最新版Moltbot)
python·编辑器·aigc·idea·ai编程·intellij idea·agi
企业老板ai培训26 分钟前
从九尾狐AI案例拆解企业AI培训的技术实现与降本增效架构
人工智能
WJX_KOI5 小时前
Open Notebook 一个开源的结合AI的记笔记软件
python
0思必得06 小时前
[Web自动化] 反爬虫
前端·爬虫·python·selenium·自动化
Elastic 中国社区官方博客6 小时前
使用 Discord 和 Elastic Agent Builder A2A 构建游戏社区支持机器人
人工智能·elasticsearch·游戏·搜索引擎·ai·机器人·全文检索
2301_822382766 小时前
Python上下文管理器(with语句)的原理与实践
jvm·数据库·python
喵手6 小时前
Python爬虫实战:从零搭建字体库爬虫 - requests+lxml 实战采集字体网字体信息数据(附 CSV 导出)!
爬虫·python·爬虫实战·零基础python爬虫教学·csv导出·采集字体库数据·字体库字体信息采集
2501_933329557 小时前
企业级AI舆情中台架构实践:Infoseek系统如何实现亿级数据实时监测与智能处置?
人工智能·架构
阿杰学AI7 小时前
AI核心知识70——大语言模型之Context Engineering(简洁且通俗易懂版)
人工智能·ai·语言模型·自然语言处理·aigc·数据处理·上下文工程
赛博鲁迅7 小时前
物理AI元年:AI走出屏幕进入现实,88API为机器人装上“最强大脑“
人工智能·机器人