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

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

问题描述

我正在使用 Google Colab 进行 PyTorch Geometric 项目以获得 CUDA 支持.由于默认情况下它的库不存在,我运行:

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

最近在导入torch_geometric时,由于版本升级,有一个CUDA版本不匹配说:

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

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

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.

为了解决这个问题,我尝试将 conda 用于特定的 CUDA 版本:

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

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

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

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?

推荐答案

来自 他们的网站

试试这个

!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天全站免登陆