为收集到的包构建轮子:torch-sparse需要大量时间合作

问题描述 投票:0回答:1

我正在看这个 Colab 笔记本:https://colab.research.google.com/drive/132hNQ0voOtTVk3I4scbD3lgmPTQub0KR?usp=sharing#scrollTo=hNERp-_xs27y

它使用 Pytorch Geometric Temproal 进行时态 GNN 训练。 我想知道是否有方法可以加快第二个单元的执行速度,其中包含安装所需库的命令。我花了大约 1 小时 30 来执行。

此外,只有当实例是 GPU 实例时,此单元中的代码才能成功安装所需的库。否则,第三个单元格中的导入会出现以下错误:

ModuleNotFoundError: No module named 'torch_geometric.utils.to_dense_adj'

对此有什么建议吗?

pip google-colaboratory pytorch-geometric
1个回答
0
投票

使用

pip install torch-sparse
后,我也遇到了同样的事情。有些人说将包裹保留在驱动器上。

但请尝试使用此单元格。我尝试了一下,成功了。

import torch

!pip uninstall torch-scatter torch-sparse torch-geometric torch-cluster  --y
!pip install torch-scatter -f https://data.pyg.org/whl/torch-{torch.__version__}.html
!pip install torch-sparse -f https://data.pyg.org/whl/torch-{torch.__version__}.html
!pip install torch-cluster -f https://data.pyg.org/whl/torch-{torch.__version__}.html
!pip install git+https://github.com/pyg-team/pytorch_geometric.git
© www.soinside.com 2019 - 2024. All rights reserved.