Skip to content
Discussion options

You must be logged in to vote

Firstly don't combine your list of Data objects into a Data object. DataLoader can work with a list of Data objects.

graph_list: List[Data] = ... # list of `Data` objects
train_loader = DataLoader(graph_list[train_index], batch_size=args.batch_size)
test_loader = DataLoader(graph_list[test_index], batch_size=args.batch_size)

You can directly use these data loaders in the above code.
Refer to graph classifications examples in pyg for more information. https://github.com/pyg-team/pytorch_geometric/blob/master/examples/proteins_topk_pool.py, https://github.com/pyg-team/pytorch_geometric/blob/master/examples/mem_pool.py etc.

Replies: 1 comment 17 replies

Comment options

You must be logged in to vote
17 replies
@kerem0comert
Comment options

@rusty1s
Comment options

@kerem0comert
Comment options

@rusty1s
Comment options

@kerem0comert
Comment options

Answer selected by kerem0comert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants