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

error in getting edge embeddings as key vectors #63

Closed
BSharmi opened this issue Apr 2, 2021 · 3 comments
Closed

error in getting edge embeddings as key vectors #63

BSharmi opened this issue Apr 2, 2021 · 3 comments

Comments

@BSharmi
Copy link

BSharmi commented Apr 2, 2021

Hi,

I updated the nove2vec to version 0.4.2 and now getting an error while pulling the all edges in a separate KeyedVectors instance step below while running the default script from the package
edges_kv = edges_embs.as_keyed_vectors()

Error shown below

AttributeError Traceback (most recent call last) <ipython-input-4-e1dd036e6a2e> in <module> 1 # Get all edges in a separate KeyedVectors instance - use with caution could be huge for big networks ----> 2 edges_kv = edges_embs.as_keyed_vectors() ~/anaconda3/envs/default/lib/python3.8/site-packages/node2vec/edges.py in as_keyed_vectors(self) 44 """ 45 ---> 46 edge_generator = combinations_with_replacement(self.kv.index2word, r=2) 47 48 if not self.quiet: ~/anaconda3/envs/default/lib/python3.8/site-packages/gensim/models/keyedvectors.py in index2word(self) 632 @property 633 def index2word(self): --> 634 raise AttributeError( 635 "The index2word attribute has been replaced by index_to_key since Gensim 4.0.0.\n" 636 "See https://github.com/RaRe-Technologies/gensim/wiki/Migrating-from-Gensim-3.x-to-4" AttributeError: The index2word attribute has been replaced by index_to_key since Gensim 4.0.0. See https://github.com/RaRe-Technologies/gensim/wiki/Migrating-from-Gensim-3.x-to-4

Do I still have to downgrade Gensim to 3.x?

Thank you!

@eliorc
Copy link
Owner

eliorc commented Apr 4, 2021

ahhhh seems like many things broke on gensim 4, I'll look into it in the weekend

In the meantime, downgrading to 3.x will help

@herobrine1010
Copy link

I encountered exactly the same problem upon calling the embedding vector by edges_embs[]. Downgrading to 3.8.3 is effective and I suggest the current version of implementation should remain on Gensim3 rather than 4🤣

@eliorc
Copy link
Owner

eliorc commented Apr 16, 2021

Resolved in 0.4.3 :D

@eliorc eliorc closed this as completed Apr 16, 2021
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

3 participants