Replies: 1 comment 21 replies
-
Didn't see this type of node in your graph. |
Beta Was this translation helpful? Give feedback.
21 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm able to use the neighbor loader with the ogb mag dataset in the example here: https://github.com/pyg-team/pytorch_geometric/blob/master/examples/hetero/to_hetero_mag.py
However, I have a problem for my own dataset.
I created this, train_data:
HeteroData(
p={
x=[1517, 96],
y=[1517]
},
mc={ x=[102354, 14] },
rx={ x=[46659, 6] },
po={ x=[2350, 36] },
dx={ x=[3496, 22] },
d={ x=[1993, 5] },
pa={ x=[53022, 81] },
(p, WP, rx)={ edge_index=[2, 46659] },
(p, H, mc)={ edge_index=[2, 102354] },
(rx, F, d)={ edge_index=[2, 46603] },
(rx, PB, pa)={ edge_index=[2, 46659] },
(mc, W, po)={ edge_index=[2, 60928] },
(mc, W, dx)={ edge_index=[2, 41426] },
(mc, SB, pa)={ edge_index=[2, 102354] }
)
But I'm having trouble getting this to work:
train_input_nodes = ('Person', torch.arange(3)) # just 3 nodes for checking code
kwargs = {'batch_size': 1, 'num_workers': 2, 'persistent_workers': True} # batch size of 1 for checking code
train_loader = NeighborLoader(train_data, num_neighbors=[2,2], shuffle=True, input_nodes=train_input_nodes, **kwargs)
The seed nodes are sampled correctly, but the other nodes are missing, as are edge indices. Here is the data from one batch:
HeteroData(
p={
x=[1, 96],
y=[1],
batch_size=1
},
mc={ x=[0, 14] },
rx={ x=[0, 6] },
po={ x=[0, 36] },
dx={ x=[0, 22] },
d={ x=[0, 5] },
pa={ x=[0, 81] },
(p, WP, rx)={ edge_index=[2, 0] },
(p, H, mc)={ edge_index=[2, 0] },
(rx, F, d)={ edge_index=[2, 0] },
(rx, PB, pa)={ edge_index=[2, 0] },
(mc, W, po)={ edge_index=[2, 0] },
(mc, W, dx)={ edge_index=[2, 0] },
(mc, SB, pa)={ edge_index=[2, 0] }
)
Is there any (maybe obvious?) reason why the other nodes and the edges aren't populated when the neighborhood is sampled? Is it necessarily my dataset, or is there an error in how I set up the loader?
Windows 10 Enterprise
torch 1.12.1+cu113
torch-cluster 1.6.0
torch-geometric 2.0.4
torch-scatter 2.0.9
torch-sparse 0.6.15
torch-spline-conv 1.2.1
torchaudio 0.12.1+cu113
torchinfo 1.7.2
torchvision 0.13.1+cu113
Beta Was this translation helpful? Give feedback.
All reactions