Open ajith01 opened 2 years ago
This is not only for custom data, but also PyG data which has not node features: IMDB-b.
What I tried was:
pyg_dataset = torch_geometric.datasets.TUDataset('./imdb-b', 'IMDB-BINARY')
graphs = deepsnap.dataset.pyg_to_graphs(pyg_dataset)
And the full error is:
Traceback (most recent call last):
File "cw224.py", line 39, in <module>
graphs = GraphDataset.pyg_to_graphs(pyg_dataset)
File "/opt/conda/envs/PR/lib/python3.8/site-packages/deepsnap/dataset.py", line 1276, in pyg_to_graphs
return [
File "/opt/conda/envs/PR/lib/python3.8/site-packages/deepsnap/dataset.py", line 1277, in <listcomp>
Graph.pyg_to_graph(
File "/opt/conda/envs/PR/lib/python3.8/site-packages/deepsnap/graph.py", line 2027, in pyg_to_graph
Graph.add_node_attr(G, key, value)
File "/opt/conda/envs/PR/lib/python3.8/site-packages/deepsnap/graph.py", line 1911, in add_node_attr
attr_dict = dict(zip(node_list, node_attr))
TypeError: 'int' object is not iterable
I thought 'int' object is maybe 'node_attr', so I transformed dataset like:
transform = torch_geometric.transforms.Compose([T.Constant(value=-1), T.Constant(value=-2)])
pyg_dataset = torch_geometric.datasets.TUDataset('./imdb-b', 'IMDB-BINARY', transform=transform)
graphs = deepsnap.dataset.pyg_to_graphs(pyg_dataset)
but I got the same error.
Thank you for your help!
Hello,
I am trying to use a custom dataset for link prediction, What i tried was
but i am getting an error:
TypeError: zip argument #2 must support iteration
The full error is
I have also tried to do this using networkx and converting it to a pyg graph and converting from there, in that case I get a different error .
This error doesn't happen when I am using a graph in Planetoid as in the Link prediction with DeepSnap example colab notebook.
What could be causing this problem? Is there a guide on how I can use custom data on DeepSnap?
Thank you for your help!