Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SebastianHurubaru opened this issue Oct 26, 2023 · 4 comments

Comments

@SebastianHurubaru
Copy link
Contributor

SebastianHurubaru commented Oct 26, 2023

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

@SebastianHurubaru
Copy link
Contributor Author

I ended up solving the issue in a deepsnap forked repo!

@zechengz
Copy link
Collaborator

zechengz commented Nov 2, 2023

Thanks @SebastianHurubaru ! Sorry that I am very busy recently. If possible, can you also create a PR for the fix?

@SebastianHurubaru
Copy link
Contributor Author

@zechengz thanks for your reply. No worries! I made this PR. Please be aware that with the fix I have done, the new release will be compatible with PyG 2.4.x + only, so for older releases of PyG you will now get a similar issue.

Let me know if you have any questions please!

zechengz added a commit that referenced this issue Nov 11, 2023
@sanjaye
Copy link

sanjaye commented Oct 25, 2024

I ended up solving the issue in a deepsnap forked repo!

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants