我正尝试在Google Colab上运行以下内容:!pip install torch_sparse
起初,它似乎工作得很好:
Collecting torch_sparse
Downloading https://files.pythonhosted.org/packages/9a/86/699eb78ea7ce259da7f9953858ec2a064e4e5f5e6bf7de53aa6c8bb8b9a8/torch_sparse-0.6.9.tar.gz
Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from torch_sparse) (1.4.1)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.7/dist-packages (from scipy->torch_sparse) (1.19.5)
Building wheels for collected packages: torch-sparse
但从这里开始,它将永远运行,不会输出任何错误消息,并且轮子永远不会构建。
我的Colab环境是托管的,并使用GPU加速器。我也可以预先安装torch和初始化cuda,但这不会改变任何事情。
发布于 2021-04-27 23:12:42
安装实际上是在30分钟到1小时后完成的(我没有确切的时间)。然而,在尝试导入torch_sparse时,我遇到了这里描述的问题:PyTorch Geometric CUDA installation issues on Google Colab
我尝试应用最流行的答案,但由于它似乎过时了,我将其更新为以下内容:
!pip install torch-geometric \
torch-sparse \
torch-scatter \
torch-cluster \
-f https://pytorch-geometric.com/whl/torch-1.8.0+cu101.html
这个安装很好,只用了几秒钟。到目前为止,它似乎使我能够从torch_geometric/torch_sparse导入所需的所有内容。如果我以后遇到任何问题,我会告诉你的!
发布于 2021-10-19 16:21:57
为了补充前面的答案,Matthias Fey建议了以下方法来下载colab中的依赖项:
!pip install -q torch-scatter -f https://data.pyg.org/whl/torch-1.9.0+cu111.html
!pip install -q torch-sparse -f https://data.pyg.org/whl/torch-1.9.0+cu111.html
!pip install -q git+https://github.com/pyg-team/pytorch_geometric.git
这个Colab link和Github link可能会有所帮助。
https://stackoverflow.com/questions/67285115
复制相似问题