Google Colab上的PyTorch Geometric CUDA安装问题 [英] PyTorch Geometric CUDA installation issues on Google Colab

查看:634
本文介绍了Google Colab上的PyTorch Geometric CUDA安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google Colab支持CUDA的PyTorch Geometric项目.由于默认情况下不存在该库,因此我运行:

!pip install --upgrade torch-scatter
!pip install --upgrade torch-sparse
!pip install --upgrade torch-cluster
!pip install --upgrade torch-spline-conv 
!pip install torch-geometric

最近,在导入 torch_geometric 时,由于版本升级,出现CUDA版本不匹配的说法:

RuntimeError:检测到PyTorch和torch_sparse是使用不同的CUDA版本编译的. PyTorch具有CUDA版本10.1,torch_sparse具有CUDA版本10.0.请重新安装与您的PyTorch安装相匹配的torch_sparse.

为解决此问题,我尝试将conda用于特定的CUDA版本,例如:

!conda install pytorch==1.4.0 cudatoolkit=10.0 -c pytorch

但是,在运行print(torch.version.cuda)时,我得到的是 10.1 作为输出,而不是我想要的10.0.

这是一个最近的错误,因为它在上周未引发此问题.有解决此问题的最佳做法吗?

解决方案

来自其网站

尝试一下

!pip install torch-geometric \
  torch-sparse==latest+cu101 \
  torch-scatter==latest+cu101 \
  torch-cluster==latest+cu101 \
  -f https://pytorch-geometric.com/whl/torch-1.4.0.html

I was working on a PyTorch Geometric project using Google Colab for CUDA support. Since it's library isn't present by default, I run:

!pip install --upgrade torch-scatter
!pip install --upgrade torch-sparse
!pip install --upgrade torch-cluster
!pip install --upgrade torch-spline-conv 
!pip install torch-geometric

Recently, while importing torch_geometric, owing to version upgrades, there's a CUDA version mismatch saying:

RuntimeError: Detected that PyTorch and torch_sparse were compiled with different CUDA versions. PyTorch has CUDA version 10.1 and torch_sparse has CUDA version 10.0. Please reinstall the torch_sparse that matches your PyTorch install.

To solve this, I tried using conda for specific CUDA version as:

!conda install pytorch==1.4.0 cudatoolkit=10.0 -c pytorch

Yet, on running print(torch.version.cuda), I get 10.1 as the output and not 10.0 as I wanted.

This is a recent error since it wasn't throwing up this issue in past week. Any best practice to solve this issue?

解决方案

From their website

Try this

!pip install torch-geometric \
  torch-sparse==latest+cu101 \
  torch-scatter==latest+cu101 \
  torch-cluster==latest+cu101 \
  -f https://pytorch-geometric.com/whl/torch-1.4.0.html

这篇关于Google Colab上的PyTorch Geometric CUDA安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆