question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupiter kernel dies when importing pytorch geometric

See original GitHub issue

🐛 Describe the bug

Hi everyone,

I have just installed PyTorch geometric in a virtual machine that is Linux Ubuntu, the virtual machine is on a CPU. I used the terminal to just install it and it gave me the message that the

pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
pip install torch-geometric

However, when I launch anaconda and I use Jupiter, I just execute this snippet the kernel dies

import os
import torch
import matplotlib.pyplot as plt
from torch_geometric.datasets import Planetoid
from torch_geometric.transforms import NormalizeFeatures

However, I already use torch and it works ok, and apparently, it is PyTorch geometric that makes crash the kernel

Environment

  • PyG version: the latest
  • PyTorch version: 1.12.1
  • OS:
  • Python version: 3.7
  • CUDA/cuDNN version: CPU
  • How you installed PyTorch and PyG (conda, pip, source): Terminal
  • Any other relevant information (e.g., version of torch-scatter):

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:29 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
j4freemancommented, Oct 31, 2022

I was having the same issue - debugged through and the issue seems to be inside this line in the initialization of pytorch_geometric/data/data.py:

from torch_sparse import SparseTensor

Tracing that through the root issue seems to be in torch_sparse calling torch.ops.load_library(spec.origin), where spec.origin is /home/john/.local/lib/python3.10/site-packages/torch_sparse/_version_cuda.so, and not quite sure how to decode that binary to debug further.

In the end I just downgraded to Python 3.6 and installed via pip instead of conda and the issue didn’t seem to persist.

1reaction
SalvatoreRacommented, Oct 13, 2022

Import torch does not problem and I managed before to run a neural network with torch, so I have found weird this behaviour

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyTorch: The kernel appears to have died. It will restart ...
I have the same issue, i can start running python or ipython on the term and then import torch, but i can not...
Read more >
The kernel appears to have died. It will restart automatically
I facing a common problem when loading pre-training model using PyTorch. Jupyter notebook is crashing “The kernel appears to have died.
Read more >
How to fix 'The kernel appears to have died. It will restart ...
LibTorch; From Source. So you have multiple options. Go to this page and select Cuda to NONE, LINUX, stable 1.1, CONDA. conda install...
Read more >
kernel dies when importing torch - You.com | The search engine you ...
pytorch/pytorchJupyter kernel dies when importing torch#2393 ... I have just installed PyTorch geometric in a virtual machine that is Linux Ubuntu, ...
Read more >
The kernel appears to have died it will restart automatically
Jupyter notebook kernel keeps dying pytorch. Dead kernel The kernel has died, and the automatic restart has failed. It is possible the kernel...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found