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.

Segmentation fault (core dumped) on import torch_geometric

See original GitHub issue

🐛 Describe the bug

When I try to import torch_geometric I get a segmentation fault (core dumped) error.

I have tried reinstalling torch_geometric, and I have verified that PyTorch and torch-scatter library do work as intended (in the sense that importing them yields no errors).

I wish I could add more detail, but I am just trying to import torch_geometric to get started and as such haven’t even used any functions yet, since every time I try to import I get this error.

import torch_geometric

I installed torch_geometric with the following command (from the getting started page): pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.11.0+cu113.html

I have also installed the CPU version to check if that would not yield any error, but still I get the same segmentation fault (core dumped) error upon importing torch_geometric.

Environment

  • PyG version: latest
  • PyTorch version: 1.11.0+cu113
  • OS: Ubuntu 20.04.4 LTS x86_64
  • Python version: 3.8.10
  • CUDA/cuDNN version: 11.3
  • How you installed PyTorch and PyG (conda, pip, source): pip
  • Any other relevant information (e.g., version of torch-scatter): ** torch_scatter: 2.0.9 ** torch_cluster: 1.6.0 ** torch_spline_conv: 1.2.1

UPDATE:

I added the output from gdb python -c "import torch_geometric" figured it might be useful:

warning: Currently logging to gdb.txt.  Turn the logging off and on to make the new setting effective.
Signal        Stop	Print	Pass to program	Description
SIG33         No	No	Yes		Real-time event 33
Starting program: /home/daniel/.local/share/virtualenvs/flow-forecasting-thesis-VrA_h4b9/bin/python -c import\ torch_geometric
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff4943700 (LWP 11265)]
[New Thread 0x7ffff4142700 (LWP 11266)]
[New Thread 0x7fffef941700 (LWP 11267)]
[New Thread 0x7fffef140700 (LWP 11268)]
[New Thread 0x7fffea93f700 (LWP 11269)]
[New Thread 0x7fffe813e700 (LWP 11270)]
[New Thread 0x7fffe593d700 (LWP 11271)]
[New Thread 0x7fffe313c700 (LWP 11272)]
[New Thread 0x7fffe093b700 (LWP 11273)]
[New Thread 0x7fffde13a700 (LWP 11274)]
[New Thread 0x7fffdb939700 (LWP 11275)]
[New Thread 0x7fffd9138700 (LWP 11276)]
[New Thread 0x7fffd6937700 (LWP 11277)]
[New Thread 0x7fffd4136700 (LWP 11278)]
[New Thread 0x7fffd1935700 (LWP 11279)]
[Thread 0x7fffd1935700 (LWP 11279) exited]
[Thread 0x7fffd4136700 (LWP 11278) exited]
[Thread 0x7fffd6937700 (LWP 11277) exited]
[Thread 0x7fffd9138700 (LWP 11276) exited]
[Thread 0x7fffdb939700 (LWP 11275) exited]
[Thread 0x7fffde13a700 (LWP 11274) exited]
[Thread 0x7fffe093b700 (LWP 11273) exited]
[Thread 0x7fffe313c700 (LWP 11272) exited]
[Thread 0x7fffe593d700 (LWP 11271) exited]
[Thread 0x7fffe813e700 (LWP 11270) exited]
[Thread 0x7fffea93f700 (LWP 11269) exited]
[Thread 0x7fffef140700 (LWP 11268) exited]
[Thread 0x7fffef941700 (LWP 11267) exited]
[Thread 0x7ffff4142700 (LWP 11266) exited]
[Thread 0x7ffff4943700 (LWP 11265) exited]
[Detaching after fork from child process 11280]
[New Thread 0x7fffd1935700 (LWP 11284)]

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffefc21a1e1 in google::protobuf::internal::ReflectionOps::FindInitializationErrors(google::protobuf::Message const&, std::string const&, std::vector<std::string, std::allocator<std::string> >*) () from /home/daniel/.local/share/virtualenvs/flow-forecasting-thesis-VrA_h4b9/lib/python3.8/site-packages/google/protobuf/pyext/_message.cpython-38-x86_64-linux-gnu.so

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DanielPerezJensencommented, Mar 29, 2022

I think it can be considered resolved! Maybe a different error message for version mismatch would be nice (if possible), but in the end it’s all RTFM I suppose.

On Tue, 29 Mar 2022, 10:28 Matthias Fey, @.***> wrote:

Super 😃 Is this issue resolved or is there anything to do from our side to close this? 😃

— Reply to this email directly, view it on GitHub https://github.com/pyg-team/pytorch_geometric/issues/4363#issuecomment-1081581748, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRZGWZUBPITO5HBKS2TOYLVCK5MNANCNFSM5R2WQQ6A . You are receiving this because you authored the thread.Message ID: @.***>

1reaction
DanielPerezJensencommented, Mar 29, 2022

So I think I figured it out, it has to with a version mismatch. For my first install I simply followed the instructions under Quick Start which installs the version for PyTorch 1.11.0. While my current work necessitated PyTorch 1.10.0.

So, my bad for not paying attention. Thanks for the help anyway!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segmentation fault when importing torch-sparse (installing ...
I am trying to install pytorch-geometric for a deep-learning project. Torch-sparse is throwing segmentation faults ...
Read more >
Segmentation Fault when importing PyTorch
When I tried to import PyTorch in python, it crashed with a segfault error: “Segmentation fault (core dumped)” is all I have about...
Read more >
Installation — pytorch_geometric documentation
e.g., No module named 'torch_*. *_cuda' , or execution simply crashes with Segmentation fault (core dumped) . We collected a lot of common...
Read more >
Why do I get a segmentation fault (SIGSEGV) when calling a ...
Hi there, I have been getting a segmentation violation error, ... Sample script for testing segmentation violation import torch as th from ...
Read more >
pytorch_geometric运行报错Segmentation fault (core dumped)
pytorch_geometric运行报错Segmentation fault (core dumped) · 检查pytorch与cuda版本是否匹配,如果版本不匹配或者都过老有可能发生上述问题。 · 如果 ...
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