【问题标题】:Colab Session Crashes on importing torch_geometric.dataColab 会话在导入 torch_geometric.data 时崩溃
【发布时间】:2022-06-16 14:03:46
【问题描述】:

我的 colab 会话在尝试导入 torch_geometric.data 模块时总是崩溃。作为参考,我写的代码如下:

import torch

def format_pytorch_version(version):

  return version.split('+')[0]

TORCH_version = torch.__version__

TORCH = format_pytorch_version(TORCH_version)

def format_cuda_version(version):

  return 'cu' + version.replace('.', '')

CUDA_version = torch.version.cuda

CUDA = format_cuda_version(CUDA_version)

!pip install torch-scatter     -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html

!pip install torch-sparse      -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html

!pip install torch-cluster     -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html

!pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html

!pip install torch-geometric

!pip install torch_geometric

from torch_geometric.data import Data 

当执行到达 lats 线时,colab 会话崩溃,我也尝试切换到 GPU 和 TPU,但没有任何反应。

日志显示:

警告:root:kernel fc8fda2d-f1ce-4808-b78f-a18a55132346 重新启动

【问题讨论】:

    标签: python pytorch-geometric gnn


    【解决方案1】:

    这周遇到了同样的问题。 Downgrading PyTorch 到与 pytorch_geometric 相同的版本似乎已经解决了这个问题。

    !pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
    

    【讨论】:

      【解决方案2】:

      执行以下代码时遇到同样的问题

      from torch_geometric.nn import MessagePassing
      

      【讨论】:

        猜你喜欢
        • 2021-06-01
        • 2021-04-25
        • 2019-08-25
        • 2021-01-16
        • 2020-04-29
        • 2020-08-13
        • 1970-01-01
        • 2021-07-17
        • 2016-11-29
        相关资源
        最近更新 更多