benedekrozemberczki / SimGNN

A PyTorch implementation of "SimGNN: A Neural Network Approach to Fast Graph Similarity Computation" (WSDM 2019).
GNU General Public License v3.0
759 stars 147 forks source link

Error adapting code #18

Closed kalkidann closed 5 years ago

kalkidann commented 5 years ago

Hey! I am facing some issues adapting your SimGNN code into my graph dataset. I keep encountering an error that says:

RuntimeError: Invalid index in scatterAdd at ../aten/src/TH/generic/THTensorEvenMoreMath.cpp:520

I even tried to change one of the training JSON files to the example of the labels and graph structure you gave. I also see a warning about size.

Am I missing something? Any help would be greatly appreciated.

kalkidann commented 5 years ago

When I add extra labels to match the number of nodes it seems to work:

{"graph_1": [[0, 1],[1, 2],[2, 3],[3, 4]], "graph_2": [[0, 1], [1, 2], [1, 3], [3, 4], [2, 4]], "labels_1": [2, 2, 2, 2, 1], "labels_2": [2, 3, 2, 3 , 5], "ged": 1}

benedekrozemberczki commented 5 years ago

I believe scatter has changed. Will take a look.

jonathan-goh commented 4 years ago

When I add extra labels to match the number of nodes it seems to work:

{"graph_1": [[0, 1],[1, 2],[2, 3],[3, 4]], "graph_2": [[0, 1], [1, 2], [1, 3], [3, 4], [2, 4]], "labels_1": [2, 2, 2, 2, 1], "labels_2": [2, 3, 2, 3 , 5], "ged": 1}

Hey! I am facing some issues adapting your SimGNN code into my graph dataset. I keep encountering an error that says:

RuntimeError: Invalid index in scatterAdd at ../aten/src/TH/generic/THTensorEvenMoreMath.cpp:520

I even tried to change one of the training JSON files to the example of the labels and graph structure you gave. I also see a warning about size.

Am I missing something? Any help would be greatly appreciated.

Hello,

I am also experiencing the same error. My graphs are similar but of different sizes. For your dataset, how did you pad the smaller graph to the larger graph? did you just add in extra "labels"?