-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error arised when running the program #32
Comments
This seems to be related to graph construction. Which data are you using? Can you check whether your graph is in the correct format? For example, check whether each node line starts with t, m, and m neighbor indices. Check whether there are exactly m neighbor indices the same as you specified m. |
I am getting the same error message. Could you further elaborate on what I am able to generate my test/training graphs of
The error message is as above:
Thanks for your support! |
So, in my case I can narrow down the error message to the following part in
With the output:
Any suggestions what is going on here? |
Hi! Sorry for the late reply. My suggestion is to check whether your input graph has duplicated edges defined, or whether it has self-loops. Sometimes nx.Graph() handles them differently from the C++ library here. Please remove duplicated edges/self-loops from your data and have a try again. |
Hey Muhan, good thinking, thanks and I really appreciate the explanation! Unfortunately, removing duplicated edges and self-loops did not solve the problem. I can get the pipeline running without problems if I convert my networkx graphs into the Matlab text file and then import the text file again. But that seems to be quite inefficient for my task considering I already have networkx graphs and you are also just converting the Matlab text file into networkx graph objects and then running them through the GNNGraph function. If I print the graph characteristics after running my networkx graph through your GNNGraph function without the Matlab text file conversion:
The output is
Is it a problem that the node tags and hence edge pairs are not sequential starting from 1? However, I am comparing graphs with string labels. I build a dictionary to store the strings and replace each string with an integer. Some nodes are exclusively found in some graphs and absent in others. Therefore those node tags are missing. |
The sequential labelling is not causing the problem. So, the error persists even when I reorder the graphs and they look like this after passing them through the GNNGraph function:
If I remove the assert statements to track the real error message afterwards, I get:
I found the following thread but I am working with the most recent PyTorch version: |
If the txt way works, can you check what are different between a direct networkx graph and a networkx graph transformed from txt format? For example, select the same graph, check the differences in node tags, feature lengths, number types, etc. I guess there are some subtle reasons causing some discrepancy between the two ways. |
python: src/lib/msg_pass.cpp:20: void n2n_construct(GraphStruct*, long long int*, Dtype*): Assertion `nnz == (int)graph->num_edges' failed.
could help to check this problem?
The text was updated successfully, but these errors were encountered: