question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error in node2vec fit

See original GitHub issue

Hello,

I ran the commands using the default data in the package and get the following error in the embed node step in the node2vec.fit step

import networkx as nx from node2vec import Node2Vec graph = nx.fast_gnp_random_graph(n=100, p=0.5) node2vec = Node2Vec(graph, dimensions=64, walk_length=30, num_walks=200, workers=4) model = node2vec.fit(window=10, min_count=1, batch_words=4)

error

--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-1-66dd459dbca1> in <module> 9 10 # Embed nodes ---> 11 model = node2vec.fit(window=10, min_count=1, batch_words=4) ~/anaconda3/envs/default/lib/python3.8/site-packages/node2vec/node2vec.py in fit(self, **skip_gram_params) 181 skip_gram_params['sg'] = 1 182 --> 183 return gensim.models.Word2Vec(self.walks, **skip_gram_params) TypeError: __init__() got an unexpected keyword argument 'size'

I have installed the required packages. Is there any step I missed?

Would appreciate a response!

Thank you!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
eliorccommented, Mar 31, 2021

Yes, gensim has changed their interface, you can wither downgrade gensim to version less than 4 or wait for the weekedn and I’ll fix it as I noted in #59

0reactions
eliorccommented, Apr 2, 2021

Solved in 4.2.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory Error · Issue #28 · eliorc/node2vec - GitHub
The following code almost takes all of the memory. node2vec = Node2Vec(G_fb, dimensions=emb_size, walk_length=80, num_walks=10, workers=4).
Read more >
TypeError: __init__() got an unexpected keyword argument ...
I am embedding a graph with Node2Vec library but I am getting this as error : TypeError: init() got an unexpected keyword argument...
Read more >
Node2Vec Explained - Towards Data Science
The Node2Vec.fit method accepts any keyword argument acceptable by gensim.Word2Vec . The parameters mentioned above are documented in the node2vec library ...
Read more >
Lab 1 - node2vec | Kaggle
Node2Vec is a random-walk based network embedding method, It proposes a biased random walk procedure, which efficiently explores diverse neighborhoods.
Read more >
How node2vec works — and what it can do that word2vec can't
In machine learning tasks that involve graphical data, we usually want to describe each node in the graph in a way that allows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found