explain_graph #4528
Replies: 3 comments 3 replies
-
Hi Jerry, I am not an expert in explain_graph, but if you want to explain graph edges, you can't get results on |
Beta Was this translation helpful? Give feedback.
-
I think this was a bug introduced in PyG 2.0.4, sorry for that. Can you try to confirm if that problem still exists when upgrading, see here? |
Beta Was this translation helpful? Give feedback.
-
Im attaching some snippets of the code If any good samiritan wants to help :') . The Model Code
The training runs as usual Now for the explainer Initliasing it
Try 1 : I get : Try 2: So I add batch Try3:: Before I had upgraded to the new version i got the same error in edge_attr My insights: in explainer.py
here i feel edge_index was given before any other parameter hence the edge_attr coming before edge_index can never reach there. I am not a pro hence I could have made some fundamental mistakes, Thanking you in advance for your time, patience and your help.. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So I have a standard GNN model with
def forward(self, x, edge_attr, edge_index, batch = torch.zeros(5)):
and in my explainer functionnode_feat_mask, edge_mask = explainer.explain_graph(graph.x, graph.edge_index)
so when i do this the error isTypeError: forward() missing 1 required positional argument: 'edge_attr'
so when i add an additional argument it says
TypeError: forward() got multiple values for argument 'edge_attr'
NOTE: Answering the above q would be very valueable. or answering this next line is also fine. Im not using edge_attr in my model at the moment, so is there a way i can remove it from forward.
Beta Was this translation helpful? Give feedback.
All reactions