What is the format of dataset of multiple graphs? #6840
-
Hi, I am working on a graph level regression issue by following this Colab, but got block by the first step, prepare my own dataset. The way I use: get a graph by using data = Data(x=x, edge_index=edge_index), and set Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Yes. Here is a simple example to build a dataset of multiple graphs: from torch_geometric.data import InMemoryDataset
class MyDataset(InMemoryDataset):
def __init__(self, data_list):
super().__init__('my_root_path')
self.data, self.slices = self.collate(data_list) where |
Beta Was this translation helpful? Give feedback.
-
Not want to open more issues but I indeed has some questions. Not sure if other people can see it. I create a dataset with 1000 graphs, for each graph, it has 654 nodes, 16038 edges and a predict label: score. But when I call data.has_isolated_nodes(), I got a error of Seems there is some inappropriate data format? Can anyone meet this error before? Thanks! |
Beta Was this translation helpful? Give feedback.
Yes. Here is a simple example to build a dataset of multiple graphs:
where
data_list
is a list ofData
objects.