当前位置:网站首页>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的版本不合。但是这样我也没有办法!
边栏推荐
猜你喜欢

PRIMAL: Pathfinding via Reinforcement and Imitation Multi-Agent Learning 代码解析
![[2022 Nioke Duo School 5 A Question Don't Starve] DP](/img/fa/f1d11297cc5f58919bcc579f0a82e9.png)
[2022 Nioke Duo School 5 A Question Don't Starve] DP

JWT actively checks whether the Token has expired

文章复现:超分辨率网络-VDSR

for 循环中的 ++i 与 i++

无代码平台字段设置:基础设置入门教程

Web3安全风险令人生畏,应该如何应对?

遇到MapStruct后,再也不手写PO,DTO,VO对象之间的转换了

mdk5.14无法烧录

Spss-系统聚类手算实操
随机推荐
How to train a deep learning model?
PowerCLi batch configuration of NTP
【PCBA program design】Grip dynamometer program
链栈的应用
bracket matching
dotnet 删除只读文件
Some problems with passing parameters of meta and params in routing (can be passed but not passed, empty, collocation, click to pass multiple parameters to report an error)
Zynq Fpga图像处理之AXI接口应用——axi_lite接口使用
如何用好建造者模式
Hands-on Deep Learning_NiN
Retrofit的使用及原理详解
MySQL field type
PowerCLi 批量配置NTP
知识分享|如何设计有效的帮助中心,不妨来看看以下几点
Configure laravel queue method using fort app manager
PRIMAL: Pathfinding via Reinforcement and Imitation Multi-Agent Learning Code Analysis
SPSS-System Clustering Hand Calculation Practice
How to understand the crawler's Scrapy framework in the simplest and most popular way?
【AGC】构建服务1-云函数示例
数字IC设计中基本运算的粗略的延时估计