【问题标题】:Error in Pytorch : libcudart.so.10.2: cannot open shared object file: No such file or directoryPytorch 中的错误:libcudart.so.10.2:无法打开共享对象文件:没有这样的文件或目录
【发布时间】:2021-11-27 20:14:08
【问题描述】:

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

!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

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

【问题讨论】:

    标签: neural-network pytorch torch pytorch-lightning pytorch-geometric


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2020-01-27
      • 1970-01-01
      • 2021-12-24
      • 2012-05-10
      • 2018-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-12
      相关资源
      最近更新 更多