sunilkmaurya / FSGNN

30 stars 9 forks source link

chameleon datasets runing error #2

Closed shikexuan666 closed 2 years ago

shikexuan666 commented 2 years ago

I encountered a running problem. When I ran the chameleons dataset, "valueerror: integers to negative integer powers are not allowed." In line 87 of "process. Py". Is this my personal problem? And how to solve this problem. Thank you very much for your reply!

Dataset: chameleon Dropout:0.5, layer_norm: True w_att:0.0005, w_fc2:0.0005, w_fc1:0.0005, lr_fc:0.02, lr_att:0.02 E:\python_project\FSGNN\process.py:143: FutureWarning: adjacency_matrix will return a scipy.sparse array instead of a matrix in Networkx 3.0. adj = nx.adjacency_matrix(G, sorted(G.nodes())) Traceback (most recent call last): File "E:/python_project/FSGNN/node_class.py", line 161, in accuracy_data = train(datastr,splitstr) File "E:/python_project/FSGNN/node_class.py", line 91, in train adj, adj_i, features, labels, idx_train, idx_val, idx_test, num_features, num_labels = full_load_data(datastr,splitstr) File "E:\python_project\FSGNN\process.py", line 148, in full_load_data features = preprocess_features(features) File "E:\python_project\FSGNN\process.py", line 87, in preprocess_features r_inv = np.power(rowsum, -1).flatten() ValueError: Integers to negative integer powers are not allowed.

sunilkmaurya commented 2 years ago

Hi! Thanks for your interest in our work. Sorry, but I cannot reproduce this issue. Can you please share your package versions for Pytorch, numpy, networkx etc. This part of pre-processing code has been used in repositories of other GNN models too, so I think the problem could be with some package incompatibilities in your setup.

sunilkmaurya commented 2 years ago

In case you are using conda, I have attached my conda environment yml file. You can setup up this environment and run the code. Please remove .txt extension from the file as Github does not allow upload of file with .yml extension. pytorch.yml.txt .

shikexuan666 commented 2 years ago

Hello, thank you for your reply. First of all, I have solved the problem I expressed above. In terms of the version of the problem, there is no major change, that is, the model can be compatible with small fluctuations of some function versions. The problem is that in the "process. Py" file, in lines 144 and 145, the matrix format of features should be adjusted to the type of "dtype = float", but the default value is not added in the source code of GitHub. Therefore, the data value error occurs in the subsequent flatten operation. The above are some of my views on the project. I hope you can try to verify some of my views. Thank you again.

sunilkmaurya commented 2 years ago

Glad you fixed the problem. Thanks for the details. I will check it out.