-
Notifications
You must be signed in to change notification settings - Fork 128
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
[BUG] type error when running node2vec_embed #800
Comments
@nyecarr any ideas? |
Yup, this n2v impl stumbled on unweighted graphs and doesn't really give a good error message. I have a PR that will default weights to 1 and raise a warning for unweighted graphs. |
In the meantime, if you are still blocked, you can do something like:
|
@Nyecarr Thanks so much, that worked! I think Word2Vec might have changed the names of some of their arguments though, because I got this error as well: File "C:\Users\d0156\OneDrive\Documents\GitHub\graspologic\graspologic\layouts\test_n2v.py", line 7, in <module>
tensors, labels = node2vec_embed(g,dimensions=128,num_walks=10,window_size=2,iterations=3)
File "C:\Users\d0156\OneDrive\Documents\GitHub\graspologic\graspologic\embed\n2v.py", line 124, in node2vec_embed
model = _learn_embeddings(
File "C:\Users\d0156\OneDrive\Documents\GitHub\graspologic\graspologic\embed\n2v.py", line 205, in _learn_embeddings
model = Word2Vec(
TypeError: __init__() got an unexpected keyword argument 'size' And so I changed the arguments 'size' to 'vector_size' and 'iter' to 'epochs' (according to their new documentation) when I was running it. Super minor, but still wanted to let you know. Again, thanks so much! |
i believe that was the reason for pinning gensim's version https://github.com/microsoft/graspologic/blob/5ed36484d32a6ed79db1b7ea087d93fc238df613/setup.cfg#L29 what version of gensim are you running @dlee0156? |
Ohhh I see, I just downloaded the most recent version which was 4.0.1. Thank you! |
Expected Behavior
Generate a node2vec embedding of the input graph
Actual Behavior
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
occurs during the _preprocess_transition_probabilities() step in node2vec_embed. I'm not sure why, but unnormalized_probs is currently a list of all 'None's.Example Code
The parameters are from layouts\auto.py
Full Traceback
Your Environment
Additional Details
Same error occurs for directed graphs too.
The text was updated successfully, but these errors were encountered: