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.

ImportError: cannot import name 'set_out_dir' from 'torch_geometric.graphgym.config'

See original GitHub issue

🐛 Describe the bug

When trying to run the basic graphgym example with "bash run_single.sh ", I get the following error:

  File "main.py", line 9, in <module>
    from torch_geometric.graphgym.config import (
ImportError: cannot import name 'set_out_dir' from 'torch_geometric.graphgym.config' (/opt/conda/lib/python3.7/site-packages/torch_geometric/graphgym/config.py)
Traceback (most recent call last):
  File "main.py", line 9, in <module>
    from torch_geometric.graphgym.config import (
ImportError: cannot import name 'set_out_dir' from 'torch_geometric.graphgym.config' (/opt/conda/lib/python3.7/site-packages/torch_geometric/graphgym/config.py)
Traceback (most recent call last):
  File "main.py", line 9, in <module>
    from torch_geometric.graphgym.config import (
ImportError: cannot import name 'set_out_dir' from 'torch_geometric.graphgym.config' (/opt/conda/lib/python3.7/site-packages/torch_geometric/graphgym/config.py)

I noticed that this might be caused due to a recent change (https://github.com/pyg-team/pytorch_geometric/pull/4338) so I tried updating my pytorch geometric version usingpip install torch-geometric --upgrade but that does not fix the issue.

Environment

  • PyG version: 2.0.4
  • PyTorch version: 1.10.0
  • OS: Linux
  • Python version:
  • CUDA/cuDNN version:
  • How you installed PyTorch and PyG (conda, pip, source): pip
  • Any other relevant information (e.g., version of torch-scatter):

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rusty1scommented, Mar 29, 2022

This seems to be indeed caused by the recent changes in #4338. You would need to install PyG from master for this:

pip install git+https://github.com/pyg-team/pytorch_geometric.git
0reactions
qingchu123commented, Jun 20, 2022

oh I have solved it by remove the graphgym package and run install.sh again,thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

torch_geometric.graphgym.config - PyTorch Geometric
config import CfgNode as CN cfg = CN() except ImportError: cfg = None warnings.warn("Could not define global config object. Please install " "'yacs'...
Read more >
Importing pytorch geometric results in an error message
I can replicate the error. The documentation in the README, to use conda install pytorch-geometric -c rusty1s -c conda-forge.
Read more >
torch-geometric - PyPI
GraphGym allows you to manage and launch GNN experiments, using a highly modularized pipeline (see here for the accompanying tutorial). git clone https://github ......
Read more >
ImportError: cannot import name (unknown location) - YouTube
ImportError : cannot import name 'blabla' from 'some_module' (unknown location)thanks for watchinglike this video, share, ...
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