GCNConv Dimension out of range (expected to be in range of [-1, 0], but got -2) #9252
-
Hello.
And similarly for the test group, I then save each group in a .pt file and import them according to
I then define a custom activation function and the model itself
And I attempt to train it according to
However I get a "Dimension out of range (expected to be in range of [-1, 0], but got -2)" error related to the line "out = model(data.x, data.edge_index)", in particular to the edge_index part as indicated by "self._cached_edge_index = (edge_index, edge_weight)" in the error message. The full error message is: File c:\Users***\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs) File c:\Users***\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py:1527, in Module._call_impl(self, *args, **kwargs) Cell In[163], line 12 IndexError: Dimension out of range (expected to be in range of [-1, 0], but got -2)" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What is the shape of |
Beta Was this translation helpful? Give feedback.
What is the shape of
data.x
? Note that even for one-dimensional features, it needs to be encoded as[num_nodes, 1]
.