Skip to content

Converting PyG 2.4.0 dataset to a list of deepsnap graphs no longer works! #53

Description

@SebastianHurubaru

Hello,

After upgrading from PyG 2.3.x to PyG 2.4.0, the keys property of torch_geometric.data.data.BaseData was refactored into a method, leading to the following error when calling GraphDataset.pyg_to_graphs

File [.../lib/python3.10/site-packages/deepsnap/dataset.py:1277](https://file+.vscode-resource.vscode-cdn.net/.../lib/python3.10/site-packages/deepsnap/dataset.py:1277), in <listcomp>(.0)
   1274     return graphs_split
   1275 else:
   1276     return [
...
   1975     data.edge_attr if "edge_attr" in data.keys else None
   1976 )
   1977 kwargs["node_label"], kwargs["edge_label"] = None, None

TypeError: argument of type 'method' is not iterable

You can use this sample to replicate the issue:

from deepsnap.dataset import GraphDataset
from torch_geometric.datasets import Planetoid

root = './tmp/cora'
name = 'Cora'
pyg_dataset= Planetoid(root, name)
graphs = GraphDataset.pyg_to_graphs(pyg_dataset)

Could someone please have a look?

Thank you in advance!

Sebastian

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions