-
Notifications
You must be signed in to change notification settings - Fork 360
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
n2v - loadEmbedding IndexError, python 2.7 #34
Comments
The nodes need to be contiguous. Do you think that can be the issue in your setting? |
Hey Palash, sorry for the late reply. Yes that was the issue. Maybe a dict-like way for accessing the embeddings could be more appropriate for such a case - such as in gensim. What do you think? :) |
Yes I agree. I am currently working on an extension of the library. Perhaps once I am done with that I can make this change for both of them. |
@dmpierre How did you load the embeddings without using loadEmbeddings()? |
Hi :) Just comment out Then you can write your own kind of |
Hi Palash,
I think the
loadEmbedding
is encountering some issues, though I train the graph smoothly. I anyway can load thetempGraph.emb
file but you may want to look at this traceback :)Traceback (most recent call last): File "train.py", line 81, in <module> n2v_model = model.train_n2v_model(G, params) File "train.py", line 32, in train_n2v_model embedding.learn_embedding(g) File "/home/pdaixmor/.virtualenvs/word_embeddings/lib/python2.7/site-packages/gem-1.0.0-py2.7.egg/gem/embedding/node2vec.py", line 84, in learn_embedding self._X = graph_util.loadEmbedding('tempGraph.emb') File "/home/pdaixmor/.virtualenvs/word_embeddings/lib/python2.7/site-packages/gem-1.0.0-py2.7.egg/gem/utils/graph_util.py", line 170, in loadEmbedding X[int(emb[0]), :] = emb_fl IndexError: index 6256 is out of bounds for axis 0 with size 6224
The text was updated successfully, but these errors were encountered: