Pytorch Geometric Datasets
I need your help. I have two set of graph structured data, one from Open Graph Benchmark (OGB) and another created with torch_geometric.data.Dataset from my own data . The data looks like:

Data(edge_index=[2, 88], edge_attr=[88, 3], x=[39, 9], y=[1, 1])  #OGB


Data(x=[23, 9], edge_index=[2, 48], edge_attr=[48, 2], y=[1]) #PyG

I am trying to use a framework developed using OGB functions, this doesn't work with data created using PyG. For example: the first part of the framework load and split the dataset into train, val and test:
# Set the random seed
random.seed(random_seed)
np.random.seed(random_seed)

# Create data loaders
split_idx = dataset.get_idx_split() # train/val/test split
loader_dict = {}
for phase in split_idx:
    batch_size = 32
    loader_dict[phase] = DataLoader(dataset[split_idx[phase]], batch_size=batch_size, shuffle=False)

When I run this code with a native ogb dataset I have no problems, when I use the PyG data return the error:

AttributeError

This is strange because they are both Pytorch objects, the only difference is that the OGB dataset is an InMemoryDataset and the PyG one is a 'Larger' dataset (https://pytorch-geometric.readthedocs.io/en/latest/notes/create_dataset.html). Is there any way to fix this without having to change the source code?
Thanks!

If you want to use the same code, you need to implement get_idx_split for your own dataset.
You can find the desired return structure in the OGB GitHub, e.g. here:
def get_idx_split(self):
    &lt; ... do something to retrieve train/test/validation set&gt;
    return {'train': train_idx, 'valid': valid_idx, 'test': test_idx}

