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:
- Created a year ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This seems to be indeed caused by the recent changes in #4338. You would need to install PyG from master for this:
oh I have solved it by remove the graphgym package and run install.sh again,thank you!