当前位置:网站首页>矩池云快速安装torch-sparse、torch-geometric等包
矩池云快速安装torch-sparse、torch-geometric等包
2022-07-31 04:45:00 【机器学习是魔鬼】
租用机器,按自己需要的环境选择一个环境,我这里选择的是Pytorch 1.10。
租用成功后点击租用页面的 Jupyterlab 链接。
Jupyterlab 里新建一个Terminal 用来安装环境,先检查Pytorch、CUDA版本,如下图可以看到我的环境Pytorch 1.10.0,CUDA 11.3。
接下来安装 torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric 这些包。
- PyG 官方提供的安装方法(部分torch版本下安装会出错):
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-{version}+cu{version}.html
其中官方源链接中的torch和cuda版本需要改成自己服务器环境中对应的。
https://data.pyg.org/whl/torch-{version}+cu{version}.html
如 CUDA11.3 Pytorch1.10.0 对应链接:https://data.pyg.org/whl/torch-1.10.0+cu113.html
官方安装方法可能出现问题: 由于 pip 安装时如果不指定包的版本时,默认会安装最新版本,以 CUDA11.3 Pytorch1.10.0 安装 torch-sparse 为例子,从官方源可以看到 torch-sparse 最新版本是 0.6.13,但是机器默认源中最新版本是:0.6.14,所以在安装过程中即使我们指定了 -f 参数,pip 也会选择从默认源安装更新的 0.6.14(容易出错,还需要编译,很麻烦)。
- 我们建议的安装方法:
安装 torch-sparse 的时候指定版本和官方源地址,这样安装都时候就会从官方源下载包安装了,官方提供的是已经在对应环境下编译好的 whl 安装包,可以免除编译过程,安装更快,也不会出现不必要的错误。
得到下面安装指令(注意我是 CUDA11.3 Pytorch1.10.0,如果你是其他版本,请将官方源中torch和cuda版本改成自己对应的):
pip install torch-scatter torch-sparse==0.6.13 torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
安装完成上面包后,再安装 torch-geometric,torch-geometric不在官方源中,所以直接 pip install 就好:
pip install torch-geometric
注意: 如果有版本要求,可以在安装的时候指定版本,这样更容易安装成功。
以上都安装完成后就可以成功导入相关包啦。
具体使用参考:官方文档
边栏推荐
- MySQL数据库备份
- Open Source Smart Future | 2022 OpenAtom Global Open Source Summit OpenAtom openEuler sub-forum was successfully held
- 手把手实现图片预览插件(三)
- ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
- 【C语言】操作符详解
- three.js 制作3D相册
- STM32HAL library modifies Hal_Delay to us-level delay
- Hand in hand to realize the picture preview plug-in (3)
- 【小土堆补充】Pytorch学习笔记_Anaconda虚拟环境使用
- MySQL fuzzy query can use INSTR instead of LIKE
猜你喜欢
Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined
WPF WPF 】 【 the depth resolution of the template
On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
Unity教程:URP渲染管线实战教程系列【1】
两个地址池r2负责管地址池r1负责管dhcp中继
Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea
递归实现汉诺塔问题
Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world
Minesweeper game - C language
已解决:不小心卸载pip后(手动安装pip的两种方式)
随机推荐
三子棋的代码实现
MySQL database backup
三道leetcode上的oj题
pom文件成橘红色未加载的解决方案
益智类游戏关卡设计:逆推法--巧解益智类游戏关卡设计
【云原生】DevOps(五):集成Harbor
Recursive implementation of the Tower of Hanoi problem
binom二项分布,
Heavyweight | The Open Atomic School Source Line activity was officially launched
Exsl file preview, word file preview web page method
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
STM32HAL库修改Hal_Delay为us级延时
Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined
mysql数据库安装(详细)
MySQL数据库增删改查(基础操作命令详解)
WPF WPF 】 【 the depth resolution of the template
[Paper reading] Mastering the game of Go with deep neural networks and tree search
From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
(5) final, abstract class, interface, inner class
idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘