GraphGym: graph classification with PyG datasets raises KeyError: 'train_graph_index'
See original GitHub issue🐛 Describe the bug
When setting up a configuration for graph classification with a dataset in PyG format an error message is received during loading of the dataset.
Error message:
Traceback (most recent call last):
File "main.py", line 38, in <module>
loaders = create_loader()
File ".../lib/python3.8/site-packages/torch_geometric/graphgym/loader.py", line 301, in create_loader
id = dataset.data['train_graph_index']
File ".../lib/python3.8/site-packages/torch_geometric/data/data.py", line 371, in __getitem__
return self._store[key]
File ".../lib/python3.8/site-packages/torch_geometric/data/storage.py", line 67, in __getitem__
return self._mapping[key]
KeyError: 'train_graph_index'
This is the configuration file I use:
out_dir: results
dataset:
format: PyG
name: MNIST
task: graph
task_type: classification
transductive: false
The error appears to be that the attribute “train_graph_index” is only set for OGB-formatted datasets in load_ogb()
in graphgym/loader.py
, but is expected to be present for every dataset in create_loader
.
Environment
- PyG version: 2.0.4
- PyTorch version: 1.10.2
- OS: Linux, kernel 5.10
- Python version: 3.8.12
- CUDA/cuDNN version: ./.
- How you installed PyTorch and PyG (
conda
,pip
, source): conda - Any other relevant information (e.g., version of
torch-scatter
):
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Managing Experiments with GraphGym - PyTorch Geometric
The experiment examines 96 models in the recommended GNN design space, on 2 graph classification datasets. Each experiment is repeated 3 times, and...
Read more >GraphGym and PyG [Advanced PyTorch Geometric Tutorial 2]
In this tutorial, we explore the structure of GraphGym, a new tool that simplifies experimentation with GNN, and its integration in PyG.
Read more >Creating a Custom Dataset in Pytorch Geometric - YouTube
Graph Neural Networks. GNN Project #2 - Creating a Custom Dataset in Pytorch Geometric. 17K views 1 year ago. DeepFindr. DeepFindr.
Read more >Advanced Representation Learning on Graphs - SNAP: Stanford
PyG (PyTorch Geometric) is a PyTorch library to enable deep learning on graphs ... simplifies implementing and working with Graph Neural Networks (GNNs) ......
Read more >Hands-On Guide to PyTorch Geometric (With Python Code) -
PyTorch Geometric(PyG) is a python framework for deep learning on irregular ... Citeseer, Pubmed), all graph classification datasets from ...
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
Yes, using a random split would work, but I understand we should use a given split if available.
I only picked MNIST as an example here, but ultimately want to use my own dataset in PyG format; there a random split would be fine.
@JiaxuanYou @HelgeS Any updates on this?