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

Bug on line 132 in the 'tudataset.py' file #5360

Closed
StevanStanovic opened this issue Sep 6, 2022 · 3 comments · Fixed by #5361
Closed

Bug on line 132 in the 'tudataset.py' file #5360

StevanStanovic opened this issue Sep 6, 2022 · 3 comments · Fixed by #5361
Labels

Comments

@StevanStanovic
Copy link

🐛 Describe the bug

Hello,

There is a bug on line 132 in the 'tudataset.py' file for the 2.1.0 version of Pytorch Geometric.
The message error is:
ValueError: not enough values to unpack (expected 3, got 2)

I fixed it by removing the 'self.sizes' part and replacing the 'num node_labels', 'num_node attributes', 'num_edge_labels' and 'num_edge attributes' methods with those from version 2.0.4.

I have attached a screenshot (PNG image) of my solution. I hope this will be useful.

Stevan Stanovic

screenshot

Environment

  • PyG version: 2.1.0
  • PyTorch version: 1.12.1
  • OS: Linux
  • Python version: 3.9.12
  • CUDA/cuDNN version: 11.6
  • How you installed PyTorch and PyG (conda, pip, source):
    conda create -n test python=3.9.12
    conda activate test
    pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
    pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.12.0+cu116.html
  • Any other relevant information (e.g., version of torch-scatter):
    torch 1.12.1+cu116
    torch-cluster 1.6.0
    torch-geometric 2.1.0.post1
    torch-scatter 2.0.9
    torch-sparse 0.6.15
    torch-spline-conv 1.2.1
    torchaudio 0.12.1+cu116
    torchvision 0.13.1+cu116
@rusty1s
Copy link
Member

rusty1s commented Sep 6, 2022

Mh, if len(out) != 3 then it should raise a RuntimeError in L127. Can you verify why this error is not thrown for you? Furthermore, try to remove any old processed data from PyG 2.0.4 and try again. I am pretty sure TUDataset works just fine with PyG 2.1.0 (at least it works flawlessly for me).

@StevanStanovic
Copy link
Author

The 'If' condition is not correct. I think the 'if' condition below is the solution for the 2.1.0 version. 

if not(isinstance(out, tuple) and len(out) == 3)

If the two conditions are True, the RumtimeError appears, and, inversely, if one of the two conditions is False.

Thank you for the quick response.

@rusty1s
Copy link
Member

rusty1s commented Sep 6, 2022

Oh, you are right. Is has to be if not(isinstance(out, tuple) or len(out) != 3).

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

Successfully merging a pull request may close this issue.

2 participants