aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.61k stars 912 forks source link

DeprecationWarning: Deprecated. Use model.wv.save_word2vec_format instead. #18

Open yuedeji opened 7 years ago

yuedeji commented 7 years ago

I met this error when I tried to run the karate sample graph. I searched online and the reason is that gensim updates their word2vec model as shown here https://groups.google.com/forum/#!topic/gensim/pjZo1ZunIZA Could you help to solve this issue?

Details: python src/main.py --input graph/karate.edgelist Walk iteration: 1 / 10 2 / 10 3 / 10 4 / 10 5 / 10 6 / 10 7 / 10 8 / 10 9 / 10 10 / 10 Traceback (most recent call last): File "src/main.py", line 104, in main(args) File "src/main.py", line 100, in main learn_embeddings(walks) File "src/main.py", line 88, in learn_embeddings model.save_word2vec_format(args.output) File "/usr/local/lib/python2.7/dist-packages/gensim/models/word2vec.py", line 1438, in save_word2vec_format raise DeprecationWarning("Deprecated. Use model.wv.save_word2vec_format instead.") DeprecationWarning: Deprecated. Use model.wv.save_word2vec_format instead.

carodak commented 7 years ago

Got the same error here. Did you fix it ?

yuedeji commented 7 years ago

No, I didn't. We can either try to use an older version of word2vec or change the source code of using word2vec. While, I am counting on the authors to fix this. If you get any lucky, please let me know.

carodak commented 7 years ago

Hello,

I found the solution here : https://github.com/aditya-grover/node2vec/issues/11

So he said : "line 88 in main.py should be changed to model.wv.save_word2vec_format"

Best reguards

WillzZhu commented 6 years ago

This change can make the code run. But the format of the embedding file is broken, which cannot be loaded again. Is there any solution to this problem?

carodak commented 6 years ago

I am not sure that I get it. Do you mean that this change broke your input (adjacences matrixes) ? It doesn't do that to me. I can properly load again and again my matrixes. I made some change not loading adjacences from files but from my numpy graphs. Anyway, it was working when I did it with adjacences list. I could load the same adjacences list 2 times or more.

Le jeudi 2 novembre 2017, HZ notifications@github.com a écrit :

This change can make the code run. But the format of the embedding file is broken, which cannot be loaded again.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aditya-grover/node2vec/issues/18#issuecomment-341538151, or mute the thread https://github.com/notifications/unsubscribe-auth/AYHIm5X1c63mikw2kQpPEkXoK1e_WxU-ks5syh0pgaJpZM4NubXp .

carodak commented 6 years ago

Sorry I mean that the input is adjacency list. And I can properly load them again and again

Le lundi 6 novembre 2017, Caro Dak carodak2@gmail.com a écrit :

I am not sure that I get it. Do you mean that this change broke your input (adjacences matrixes) ? It doesn't do that to me. I can properly load again and again my matrixes. I made some change not loading adjacences from files but from my numpy graphs. Anyway, it was working when I did it with adjacences list. I could load the same adjacences list 2 times or more.

Le jeudi 2 novembre 2017, HZ <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> a écrit :

This change can make the code run. But the format of the embedding file is broken, which cannot be loaded again.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aditya-grover/node2vec/issues/18#issuecomment-341538151, or mute the thread https://github.com/notifications/unsubscribe-auth/AYHIm5X1c63mikw2kQpPEkXoK1e_WxU-ks5syh0pgaJpZM4NubXp .

WillzZhu commented 6 years ago

Oh the adjacency list (input) is fine, but my embedding matrix (output file) is broken, with wrong dimension (output [14, 128] while it should be [34, 128] in author's experiment), mixed with '[' and ']' symbols :(

I'm sure the parser arguments are all correct.

carodak commented 6 years ago

I don't know what to say. I did not have such problems (I was using python 3, I made some change to make it work with python 3). The problem is that I didn't take a look at my code since 3 months and I do not have a computer with everything installed in atm. It's a bit messy, ahah. I can just suggest to take a look at my code even if it's node2vec applied for something else you may find something usefull.

2017-11-07 4:51 GMT+01:00 HZ notifications@github.com:

Oh the adjacency list (input) is fine, but my embedding matrix (output) is broken, with wrong dimension (output 14128 while it should be 34128 in author's experiment), mixed with '[' and ']' symbols :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aditya-grover/node2vec/issues/18#issuecomment-342367847, or mute the thread https://github.com/notifications/unsubscribe-auth/AYHIm7CMxy15NEo2TgH-8eND7AaiktT3ks5sz9OzgaJpZM4NubXp .

alavertu commented 6 years ago

Make sure you're using the correct python package versions. I'm using the python 2.7 and the package versions specified in the requirements.txt file, not having any issues.

urmisaha commented 5 years ago

Same for me. I used the exact versions specified in the requirements.txt file and the code ran successfully. I ran the following: pip install networkx==1.11 numpy==1.11.2 gensim==0.13.3 And then ran this: python src/main.py --input graph/karate.edgelist --output emb/karate.emd Code ran successfully. :)

king-zkai commented 5 years ago

I'm using the python 2.7 and the package versions specified in the requirements.txt file, but the modules cannot be installed. 图像 001 图像 002 图像 003 How can I install the required modules correctly? Thank you very much!

amitmishramtech commented 3 years ago

I am not getting any output graph just getting only 👍 Walk iteration: 1 / 10 2 / 10 3 / 10 4 / 10 5 / 10 6 / 10 7 / 10 8 / 10 9 / 10 10 / 10