Open naveenkumarmarri opened 3 years ago
if you check len(dataset)
it should be 1
. The DataLoader has one graph to batch, so it will always return the whole graph.
I am guessing, you want to batch nodes and not graphs. So, check out torch_geometric.data.NeighborSampler
or torch_geometric.data.RandomNodeSampler
.
Note: I am new to the library, so this might not be the best answer.
@wsad1 is right: The DataLoader
is only useful in case you want to batch multiple graphs together, not for splitting up/sampling a large graph. In case you want to train on a large graph, you have to make use of sampling, e.g., via NeighborSampler
. An example of link prediction on large graphs can be found here.
❓ Questions & Help
I'm trying to perform link prediction on large undirected graph. During minibatching phase I pass a single
Data
object with all the edges(1293978946) and all nodes(8595301). When I create a dataloader around the dataset, I get the entire graph during the minibatch iteration instead of batch of sizebatch_size
.The above loop returns
Am I missing something ?