I recently started to use Graph NN, and still it is challenging for me.
I was following this tutorial: https://www.youtube.com/watch?v=Rws9mf1aWUs . Instead Attention Temporal Graph Convolutional, I want to use Graph ConvLSTM, however, I have trouble constructing it. I will appreciate a lot, if someone can help. Below is the code:
Based on the error message it seems your input contains invalid indices which are used in the scatter_add_ operation.
In particular indices in [0, 19] are expected while your input contains at least an index of 20.
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.
Thank you so much.
I was following this notebook in order to create the dataset: Google Colab.
In my example I have this result: Data(x=[24, 20, 6], edge_index=[2, 552], edge_attr=[552], y=[24, 6]), where 24 is number of nodes, 20 is node features, 6 is timesteps.
Do I need to create my dataset different way for Graph ConvLSTM?
# Error Here ! => Number of nodes
gcn = GCN(in_channels=1, hidden_channels=32, out_channels=12, num_layers=1)
for time, snapshot in enumerate(train_loader):
if time == 1:
break
print(f"{snapshot=}")
import pdb; pdb.set_trace()
gcn(snapshot.x, edge_index=snapshot.edge_index, edge_weight=snapshot.edge_weight, edge_attr=snapshot.edge_attr)
>>> snapshot=Data(x=[32, 1, 24], edge_index=[2, 116], edge_attr=[116], y=[32, 24])
>>> RuntimeError: index 2 is out of bounds for dimension 0 with size 1