Skip to content
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

ModuleNotFoundError: No module named 'node2vec' #49

Closed
EdisonLeeeee opened this issue Mar 19, 2021 · 6 comments
Closed

ModuleNotFoundError: No module named 'node2vec' #49

EdisonLeeeee opened this issue Mar 19, 2021 · 6 comments

Comments

@EdisonLeeeee
Copy link
Contributor

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-ab061214f9c6> in <module>
      7 import torch.optim as optim
      8 from deeprobust.graph.utils import accuracy
----> 9 from deeprobust.graph.defense.pgd import PGD, prox_operators
     10 import warnings
     11 

~/DeepRobust/deeprobust/graph/defense/__init__.py in <module>
      4 from .prognn import ProGNN
      5 from .simpgcn import SimPGCN
----> 6 from .node_embedding import Node2Vec, DeepWalk
      7 import warnings
      8 try:

~/DeepRobust/deeprobust/graph/defense/node_embedding.py in <module>
     16 from sklearn.preprocessing import normalize
     17 from sklearn.metrics import f1_score, roc_auc_score, average_precision_score, accuracy_score
---> 18 from node2vec import Node2Vec as N2V
     19 
     20 class BaseEmbedding:

ModuleNotFoundError: No module named 'node2vec'

Hi, is there a missing file node2vec?

@ChandlerBang
Copy link
Collaborator

Hi, just “pip install node2vec”. See details in requirements.txt

@EdisonLeeeee
Copy link
Contributor Author

Hi, Wei Jin.

Thanks, it works.
The implementation of node2vec is much slower and the sp.csr_matrix needs to be transformed into nx.Graph.
I think it's necessary to implement Node2Vec in deeprobust.

@ChandlerBang
Copy link
Collaborator

Yeah, I totally agree. The current model serves as a temporary solution and I shall implement it in the future. Currently I am working on adding graph classification and several other attack/defense methods.

Thank you for your suggestion.

@EdisonLeeeee
Copy link
Contributor Author

I can help you implement this :), just wait a moment.

@EdisonLeeeee
Copy link
Contributor Author

Kindly refer to #51

@ChandlerBang
Copy link
Collaborator

Thank you so much!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants