当前位置:网站首页>PyTorch Geometric (PyG) 安装教程
PyTorch Geometric (PyG) 安装教程
2022-08-04 21:05:00 【诸神缄默不语】
PyG官方下载主页:Installation — pytorch_geometric documentation
以下仅考虑Linux系统的情况。(在Windows上跑GNN是不是太身残志坚了)
安装PyG需要先安装PyTorch,安装PyTorch可以参考我之前写的博文:PyTorch安装教程
以下根据PyTorch和对应的cuda版本来写PyG的安装方式。对应可行的安装时间会对应附上。
由于我在遇到对应情况时才能撰写对应博文,更多情况看以后我会不会遇上吧。
注意:这里对应的cuda版本,一般情况下只要跟cudatoolkit对应上就行。
除非遇上这种坑爹情况:Is PyTorch 1.7.1 and cuda 9.2 able to use neighbor_sample? · Issue #179 · rusty1s/pytorch_sparse
一般来说直接更换cudatoolkit版本就能解决,这还解决不了再说。
1. PyTorch 1.11.0
1.1 cudatoolkit 10.2
2022.8.3
我安装PyTorch用的Python3.8,命令是conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=10.2 -c pytorch
这是符合quick start的场景,所以可以直接安装:
conda install pyg -c pyg
2. 测试安装效果
import torch
from torch_geometric.data import Data
edge_index = torch.tensor([[0, 1, 1, 2],
[1, 0, 2, 1]], dtype=torch.long)
x = torch.tensor([[-1], [0], [1]], dtype=torch.float)
data = Data(x=x, edge_index=edge_index)
print(data)
输出:
my_env/lib/python3.8/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.1
warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
Data(x=[3, 1], edge_index=[2, 4])
可以看到这里scipy和numpy的版本不合。但是这样我也没有办法!
边栏推荐
- Pinduoduo open platform order information query interface [pdd.order.basic.list.get order basic information list query interface (according to transaction time)] code docking tutorial
- Web3时代的战争
- Named routes, the role of name in components
- [2022 Hangzhou Electric Multi-School 5 1003 Slipper] Multiple Super Source Points + Shortest Path
- DSPE-PEG-Aldehyde,DSPE-PEG-CHO,磷脂-聚乙二醇-醛基一种疏水18碳磷脂
- 大资本已开始逃离加密领域?
- After the tester with 10 years of service "naked resignation" from the big factory...
- OD-Model【6】:YOLOv2
- Uniapp微信雪糕刺客单页小程序源码
- SPSS-System Clustering Hand Calculation Practice
猜你喜欢
随机推荐
dotnet 删除只读文件
1.读写点云文件
Three ways to set a specific device UWP XAML view
LayaBox---TypeScript---Example
项目难管理?先学会用好甘特图(内附操作方法及实用模板)
Web3安全风险令人生畏,应该如何应对?
【Programming Ideas】
【一起学Rust | 进阶篇 | Service Manager库】Rust专用跨平台服务管理库
visual studio 2015 warning MSB3246
Comic | Two weeks after the boss laid me off, he hired me back and doubled my salary!
Pinduoduo open platform order information query interface [pdd.order.basic.list.get order basic information list query interface (according to transaction time)] code docking tutorial
[2022 Hangzhou Electric Power Multi-School 5 1012 Questions Buy Figurines] Application of STL
Spss-一元回归实操
【C语言】指针和数组的深入理解(第三期)
两种白名单限流方案(redis lua限流,guava方案)
结构体小结
LayaBox---TypeScript---首次接触遇到的问题
SAP ABAP OData 服务如何支持 $select 有选择性地仅读取部分模型字段值试读版
【2022杭电多校5 1003 Slipper】多个超级源点+最短路
经验分享|盘点企业进行知识管理时的困惑类型