GNN Explainer example not running #4660
Unanswered
Everyday-seu
asked this question in
Q&A
Replies: 1 comment
-
Yes, this is sadly a bug in PyG 2.0.4, but it is fixed in master. See here on how to upgrade. |
Beta Was this translation helpful? Give feedback.
0 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.
-
hello dear,
I tried to run gnn_explainer example. I am getting the following error.
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('D:/PycharmProjects/HGT_test/GNNExplainer.py', wdir='D:/PycharmProjects/HGT_test')
File "D:\JetBrains\PyCharm 2021.2.2\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\JetBrains\PyCharm 2021.2.2\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/PycharmProjects/HGT_test/GNNExplainer.py", line 48, in
edge_weight=edge_weight)
File "D:\Anaconda3\lib\site-packages\torch_geometric\nn\models\gnn_explainer.py", line 208, in explain_node
prediction = self.get_initial_prediction(x, edge_index, **kwargs)
File "D:\Anaconda3\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "D:\Anaconda3\lib\site-packages\torch_geometric\nn\models\explainer.py", line 235, in get_initial_prediction
out = self.model(x, edge_index, **kwargs)
File "D:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "D:/PycharmProjects/HGT_test/GNNExplainer.py", line 25, in forward
x = F.relu(self.conv1(x, edge_index, edge_weight))
File "D:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "D:\Anaconda3\lib\site-packages\torch_geometric\nn\conv\gcn_conv.py", line 195, in forward
size=None)
File "D:\Anaconda3\lib\site-packages\torch_geometric\nn\conv\message_passing.py", line 317, in propagate
out = self.message(**msg_kwargs)
File "D:\Anaconda3\lib\site-packages\torch_geometric\nn\conv\gcn_conv.py", line 203, in message
return x_j if edge_weight is None else edge_weight.view(-1, 1) * x_j
RuntimeError: The size of tensor a (13264) must match the size of tensor b (19) at non-singleton dimension 0
I'm using torch_geometric 2.0.4
Beta Was this translation helpful? Give feedback.
All reactions