当前位置: 首页 > news >正文

PyTorch 2.6.0没有对应的torch-sparse版本,不要下载pytorch最新版本,否则用不了图神经网络torch_geometric

报错了

Looking in links: https://data.pyg.org/whl/torch-2.6.0+cpu.html
Requirement already satisfied: torch-scatter in c:\users\qiaolikui\.conda\envs\gdn\lib\site-packages (2.1.2+pt25cpu)
ERROR: Could not find a version that satisfies the requirement torch-sparse (from versions: none)
ERROR: No matching distribution found for torch-sparse

这个错误说明:

torch-scatter 已经成功安装了(版本:2.1.2+pt25cpu
❌ 但 torch-sparse 没有找到适用于 PyTorch 2.6.0+cpu 的版本


🔍 根本原因:

torch-sparse官方预编译版本 目前只支持到 PyTorch 2.5.x还不支持 2.6.0,所以:

https://data.pyg.org/whl/torch-2.6.0+cpu.html 实际是空的(没有对应 whl 文件)


✅ 解决方案选项如下:


✅ 方案一(推荐): 降级 PyTorch 到 2.5.1+cpu,完美兼容 PyG

pip uninstall torch torchvision torchaudio -y

pip install torch==2.5.1+cpu torchvision==0.16.1+cpu torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu

然后再装 PyG 的依赖:

pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-2.5.1+cpu.html
pip install torch-geometric

✅ 这个方案 最稳定、最推荐,兼容所有 PyG 模块,无需手动编译


⚠️ 方案二(不推荐):手动编译 torch-sparse

可以从源码安装:

pip install git+https://github.com/rusty1s/pytorch_sparse.git

⚠️ 需要本机有 C++ 编译环境(Visual Studio C++ Build Tools),不然会编译失败!


✅ 总结:现在的最佳路径是

步骤命令
卸载 PyTorch 2.6.0pip uninstall torch torchvision torchaudio -y
安装 PyTorch 2.5.1 CPU 版pip install torch==2.5.1+cpu torchvision==0.16.1+cpu torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu
安装 PyG 依赖pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-2.5.1+cpu.html
安装 PyGpip install torch-geometric

http://www.dtcms.com/a/99839.html

相关文章:

  • vmware_unbantu刷新IP
  • EtherNet/IP转ProfiNet协议转换网关驱动西门子PLC与流量计的毫秒级压力同步控制
  • 洛谷题单1-P5706 【深基2.例8】再分肥宅水-python-流程图重构
  • MySQL单表查询、多表查询
  • linux实现rsync+sersync实时数据备份
  • Redis-快速入门
  • GPT Actions
  • 【硬件测试】基于FPGA的16QAM+帧同步系统开发与硬件片内测试,包含高斯信道,误码统计,可设置SNR
  • 【Find My全球市场观察:中国制造如何改写游戏规则?】
  • 游戏引擎学习第191天
  • 【Python】工作笔记:返回当月第一天、昨天;上月第一天、当天;全年节假日
  • 淘宝客户端动态化页面搭建
  • Linux课程学习一
  • 【区块链安全 | 第五篇】DeFi概念详解
  • Kubernetes比同规格虚拟机性能相差多少?
  • 《Express:Node.js 里的 “闪电侠”》
  • Playwright从入门到实战:比Selenium更快的数据爬取案例实战
  • STL-string容器
  • 蓝桥杯嵌入式学习笔记
  • SQL IF(xxx, 1, 0) 窗口函数
  • 【嵌入式学习3】TCP服务器客户端 - UDP发送端接收端
  • Supabase 匿名密钥与服务角色密钥详细对比文档
  • .NET 9 中的新增功能:关键更新和 C# 12 功能简化
  • C#核心学习(一)面向过程与面向对象编程---初识类和对象
  • 深入理解MySQL聚集索引与非聚集索引
  • fetch的语法规则及常见用法
  • EasyExcel 与 Apache POI:Java 操作 Excel 的详解
  • 6-1-1 利用AI完成一个可视化看板
  • 如何监控和优化服务器的 CPU 性能
  • 视频联网平台智慧运维系统:智能时代的城市视觉中枢