snap-stanford / ogb

Benchmark datasets, data loaders, and evaluators for graph machine learning
https://ogb.stanford.edu
MIT License
1.89k stars 397 forks source link

AttributeError: 'GlobalStorage' object has no attribute 'num_classes' #337

Closed aamna2401 closed 1 year ago

aamna2401 commented 2 years ago

data.num_classes Traceback (most recent call last): File ~/anaconda3/lib/python3.8/site-packages/torch_geometric/data/storage.py:50 in getattr return self[key] File ~/anaconda3/lib/python3.8/site-packages/torch_geometric/data/storage.py:70 in getitem return self._mapping[key] KeyError: 'num_classes' During handling of the above exception, another exception occurred: Traceback (most recent call last): Input In [40] in <cell line: 1> data.num_classes File ~/anaconda3/lib/python3.8/site-packages/torch_geometric/data/data.py:362 in getattr return getattr(self._store, key) File ~/anaconda3/lib/python3.8/site-packages/torch_geometric/data/storage.py:52 in getattr raise AttributeError( AttributeError: 'GlobalStorage' object has no attribute 'num_classes'

weihua916 commented 2 years ago

Can you give the code to reproduce it?