Pytorch_geometric: Classes in the QM9 dataset

Created on 22 Oct 2019  ยท  10Comments  ยท  Source: rusty1s/pytorch_geometric

โ“ Questions & Help


What happened to the QM9 dataset? Previously there were multiple regression targets. Now it seems that y is a 1-D tensor, and when I query num_classes it reports "30.5564...".
The qm9_nn_conv example is also no longer functional as a result of these changes. Any insights appreciated!

All 10 comments

I can not reproduce this. Which PyG version are you using? It is working in current master branch:

Batch(batch=[230], edge_attr=[400, 4], edge_index=[2, 400], pos=[230, 3], x=[230, 13], y=[32, 16])

Curious. I am on 1.3.2

Would you be able to give me the code you used to generate the above? Thank you!

Sure

from torch_geometric.datasets import QM9
from torch_geometric.data import DataLoader

dataset = QM9('/tmp/QM9')
print(dataset)
print(dataset[0])
loader = DataLoader(dataset, batch_size=32)

for data in loader:
    print(data)
    break

Thank you -- that is very helpful. I was loading a slightly different dataset (?) as follows:
dataset = QM9('/tmp/molecules')
which was working fine for a while, but has somehow changed. I will use the dataset you are using above. This fixes my issue -- thanks again.

Great!

I am facing the same issue when loading the preprocessed QM9 from 'http://www.roemisch-drei.de/qm9.zip'. When I first load it and print dataset.data, I got

Data(edge_attr=[4823498, 5], edge_index=[2, 4823498], name=[129433], pos=[2333625, 3], x=[2333625, 13], y=[129433])

showing y has one single dimension. Then I completely delete the dataset cache and re-download QM9 (also from http://www.roemisch-drei.de/qm9.zip), I print dataset.data again, and surprisingly got

Data(edge_attr=[4823498, 5], edge_index=[2, 4823498], name=[129433], pos=[2333625, 3], x=[2333625, 13], y=[129433, 19])

showing y has 19 tasks. Can you please have a check? Thanks.

Another issue is, the dataset shows edge_attr should have 5 dimensions. But when I print dataset[0], I got

Data(edge_attr=[8, 6], edge_index=[2, 8], name=[1], pos=[5, 3], x=[5, 13], y=[1, 19])

showing it has 6 dimensions. This makes 1-qm9.py in k-gnn fail to work.

I am using python 3.8.1, pytorch 1.4.0 and pyg 1.4.2

There was a small bug in QM9 where the data was not correctly loaded when using transforms. It should have been fixed in PyG 1.4.3.

Oh sorry, it is only fixed on master.

Was this page helpful?
0 / 5 - 0 ratings