1

我正在运行一些图形神经网络,并且安装了以下版本:

!pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html 
!pip install torch-geometric
!pip install pytorch_lightning

但是,我收到以下错误:

import pandas as pd
import numpy as np
import os.path as osp
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.loader import DataLoader
from torch_geometric.utils import to_networkx
from random import shuffle, randint
import networkx as nx
import matplotlib.pyplot as plt
import random 
from tqdm import tqdm
import torch.nn.functional as F
from torch.nn import Linear, LayerNorm, ReLU
from torch_scatter import scatter
from torch_geometric.nn import GENConv, DeepGCNLayer
from torch_geometric.data import RandomNodeSampler

我收到以下错误:

OSError                                   Traceback (most recent call last)
<ipython-input-5-ba81a7ec5178> in <module>()
     14 import torch.nn.functional as F
     15 from torch.nn import Linear, LayerNorm, ReLU
---> 16 from torch_scatter import scatter
     17 from torch_geometric.nn import GENConv, DeepGCNLayer
     18 from torch_geometric.data import RandomNodeSampler

2 frames
/usr/lib/python3.7/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    362 
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

OSError: libcudart.so.10.2: cannot open shared object file: No such file or directory

我需要一些帮助来解决这个问题。

4

1 回答 1

0

您必须使用相同的 CUDA 版本编译您的 PyG 及其扩展。它必须与 PyTorch 在您的系统中使用的版本相同。使用 torch.version.cuda 检查您的 CUDA 版本,并在安装命令中使用正确的 Cuda 版本。

于 2021-10-11T05:25:24.720 回答