pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.02k stars 3.62k forks source link

OOM when using train_test_split_edges method #2323

Open Mobzhang opened 3 years ago

Mobzhang commented 3 years ago

When I use train_test_split_edges method to split a large graph, memory will overflow. What should I do?

rusty1s commented 3 years ago

How big is your graph? I guess that memory will overflow because of the creation of the neg_adj_mask, which is a dense bool tensor of shape [num_nodes, num_nodes]. You may want to remove the creation of this matrix and replace it with negative_sampling to see if that fixes your issues.

Mobzhang commented 3 years ago

thanks for your reply. my graph has19K nodes 144K edges. I'll try it based on your advice.