question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GEDDataset num_classes request leads to AttributeError

See original GitHub issue

🐛 Bug

When loaded a GEDDataset and querying the num_classes as descriped in the tutorial (dataset.num_classes) an AttributeError: 'NoneType' object has no attribute 'dim'-error is thrown.

To Reproduce

Steps to reproduce the behavior:

  1. Load the IMDBMulti dataset with GEDDataset
  2. Ask the num_classes.

Code for reproducing error:

from torch_geometric.datasets import GEDDataset
dataset = GEDDataset(root='/datasets/IMDBMulti', name="IMDBMulti")
print(dataset.num_classes)

Expected behavior

I would have expected a return of the number of classes: 3.

Environment

  • OS: Ubuntu 18.04 in Docker
  • Python version: 3.6.5
  • PyTorch version: 1.4.0
  • CUDA/cuDNN version: 10.1.243 / 7.6.5.32
  • GCC version: 7.5.0
  • Any other relevant information: Basis of our Dockerfile is from your provided dockerfile.

Additional context

I noticed that in the examples, the ground truth is saved in the key 'y'.

data = dataset[0]
data.keys()

would return something like ['edge_index', 'y']

The GEDDataset returns ['edge_index', 'i'].

Also tested with the ALKANE dataset, same problem.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rusty1scommented, Apr 29, 2020

The i refers to the index of the graph in the dataset, so that you can access the GED between two pairs of graphs via dataset.ged[data1.i, data2.i]. I think we should mention this in the documentation.

1reaction
rusty1scommented, Oct 14, 2020

You can access them via data.x.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GEDDataset num_classes request leads to AttributeError #1156
When loaded a GEDDataset and querying the num_classes as descriped in the tutorial ( dataset.num_classes ) an AttributeError: 'NoneType' object ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found