Open JohnYao93 opened 2 years ago
I have the following error message:
import torch_geometric.graphgym terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)
Thanks for reporting. Does only the import of torch_geometric.graphgym
throw this error? Is it possible to debug for you which import within torch_geometric/graphgym/__init__.py
causes this error exactly (e.g., via print debugging)?
Yeah it seems like there are a few places it breaks actually in the init file;
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)
:from .contrib import * # noqa from .models import * # noqa from .utils import * # noqa
from .loader import create_loader from .logger import set_printing, create_logger
from .model_builder import create_model
from .train import train
, I get Segmentation fault (core dumped)
.I didn't keep running it after these, as I was pretty sure without half the imports the file wouldn't really run at all. But at these particular imports there were issues as stated.
After some experimentation it doesn't seem to occur elsewhere without importing graphgym. Seems like just that package is the main issue.
I assume this has something to do with https://github.com/pyg-team/pytorch_geometric/blob/master/torch_geometric/graphgym/contrib/act/__init__.py. What's the output of __all__
for you? Does it crash there?
You're right, there does seem something off here. I pdb'd the file as so:
from os.path import dirname, basename, isfile, join
import glob
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [
basename(f)[:-3] for f in modules
if isfile(f) and not f.endswith('__init__.py')
]
import pdb; pdb.set_trace()
and got the following:
john@johns-laptop:~/Documents/pytorch_geometric/graphgym$ python -m pdb test.py /home/john/Documents/pytorch_geometric/graphgym/test.py(1)<module>() -> import torch_geometric.graphgym (Pdb) c --Return-- /home/john/.local/lib/python3.8/site-packages/torch_geometric/graphgym/contrib/act/__init__.py(8)<module>()->None -> import pdb; pdb.set_trace() (Pdb) i *** NameError: name 'i' is not defined (Pdb) print(__all__) []
Should __all__
be empty?
Yes, __all__
should be empty since the folder does not contain any files. I am wondering why this is not the case for you?
No as you can see in the printout it is empty. Just wondering. Must be some other issue.
Oh, I misread. So the issue is somewhere else? Do you know what's the variable i
the error is referring to?
Ah yes that is just a typo. I was attempting to debug using interactive mode on pdb, and thought i
might be the right key. Irrelevant in this case, though.
This is a weird error I haven't encountered before. It will be great if you can pinpoint where the segmentation fault error occurs. Also, based on your description, you may want to fully uninstall your conda+pip PyG, and reinstall just one version again. Maybe it's because of cross-referencing across different installation/code bases.
😵 Describe the installation problem
Hello,
I have installed the latest versions of pyg with conda as well as with pip, and trying either one separately as well, and for some reason I cannot install a version where graphgym works. I have the versions tagged below
Environment
conda
,pip
, source): piptorch-scatter
): torch-scatter version 2.0.9