shchur / overlapping-community-detection

Implementation of "Overlapping Community Detection with Graph Neural Networks"
http://www.daml.in.tum.de/nocd
MIT License
157 stars 45 forks source link

the data format #6

Closed whu-zhigao closed 2 years ago

whu-zhigao commented 3 years ago

Hi, @shchur Would you please let me know the data format of the input graphs? I convert several graphs from mtx to npz, but the following errors occurred. ' Traceback (most recent call last): File "example.py", line 14, in G = nocd.utils.load_dataset(path_to_dataset) File "/home/community/nocd/nocd/utils.py", line 49, in load_dataset A = sp.csr_matrix((loader['adj_data'], loader['adj_indices'], KeyError: 'adj_data' '

shchur commented 3 years ago

Hi, the code shown in your snippet is different from what is provided in the library. Please see nocd/data.py for the load_dataset function.

Bisma1 commented 2 years ago

when we run the .ipynb file .At what location the result gets stored .

shchur commented 2 years ago

I'm sorry, I don't think I understand the question. Can you please clarify?

The results in the Jupyter notebook (conductance computation, visualization of the sorted adjacency matrix) are not saved to disk, they are only shown in the notebook.

Bisma1 commented 2 years ago

i am saying i want the resultant communities to be stored in the output but i dont know where to execute that code either, i am a beginner of python but my project is somewhat related to this so i need to run this code and compare the output file with other outputs given by other methods. can you please help me ..moreover after installing every said module i am getting cuda error

shchur commented 2 years ago

The community assignments are stored in the binary matrix Z_pred (shape num_nodes x num_communities). Z_pred[i, j] == 1 means that node i is assigned to community j.

You can save the result to disk with np.save("communities.npy", Z_pred) and then load it in a different file with Z_pred = np.load("communities.npy").

I cannot help with the CUDA error, unfortunately, you should try googling / using StackOverflow.

Bisma1 commented 2 years ago

thankyou . i executed this code via google colab but it seems like this "true" error cannot b solved .

shchur commented 2 years ago

Sorry, I cannot help you with this, unless you post the error message + a code snippet that reproduces it.

Bisma1 commented 2 years ago

Screenshot (2)

AFter this i somehow managed to make a change via VSCODE but again it comes up with the error saying "TORCH NOT COMPILED WITH CUDA ENABLED"

Bisma1 commented 2 years ago

Screenshot (3) Here it is
can you please help me in executing this code . I am a student and need to run this CODE as soon as possible before my deadline.

shchur commented 2 years ago

Sorry, I don't really have time to help anyone with coursework. TORCH NOT COMPILED WITH CUDA ENABLED means that you don't have a GPU, and running this code requires having a GPU on your machine. Please use Google / StackOverflow to look for answers.

Bisma1 commented 2 years ago

Thankyou