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

Errors when loading included datasets #408

Open
mgandaman opened this issue Nov 28, 2022 · 1 comment
Open

Errors when loading included datasets #408

mgandaman opened this issue Nov 28, 2022 · 1 comment

Comments

@mgandaman
Copy link

mgandaman commented Nov 28, 2022

I'm running into two issues when trying to load a dataset.

  1. with the TUDataset, the clean URL doesn't exist anymore. I changed tudataset.py -->
    line 55: url_clean = ("https://www.chrsmrrs.com/graphkerneldatasets")
    and that seems to work.

  2. This error happened with any TUDataset and with OGB
    When I load a dataset I get an error from dataset.py/

dataset = TUDataset(name='PROTEINS', clean=True)

Here's the error:
----> 2 dataset = TUDataset(name='PROTEINS', clean=False)

File ~/miniconda3/envs/GraphDLenv/lib/python3.8/site-packages/spektral/datasets/tudataset.py:66, in TUDataset.init(self, name, clean, **kwargs)
64 self.name = name
65 self.clean = clean
---> 66 super().init(**kwargs)

File ~/miniconda3/envs/GraphDLenv/lib/python3.8/site-packages/spektral/data/dataset.py:119, in Dataset.init(self, transforms, datainputs, **kwargs)
116 self.download()
118 # Read graphs
--> 119 self.graphs = self.read(datainputs)

...
TypeError: read() takes 1 positional argument but 2 were given

I'm not wise enough in the ways of Python to know why it's not loading. Any help is appreciated, thanks for this awesome library!

@mgandaman
Copy link
Author

I uninstalled and reinstalled the package and it works now. I realized the issue - I implemented the dataset.read() method as outlined here (https://graphneural.network/data/, under "Dataset"), in the dataset.py script. Should I not have implemented read(self) in dataset.py ? It worked for my own data but was clearly what caused the issue as I explained above.
The implementation of this method:
class MyDataset(Dataset):
def read(self):
return [Graph(x=x, adj=adj, y=y) for x, adj, y in some_magic_list]
Is that meant to be implemented as a new custom class with custom name? I guess that would make sense, but I am always finding things I do not understand about classes.
In any event, thanks for the help!

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

1 participant