shenweichen / GraphEmbedding

Implementation and experiments of graph embedding algorithms.
MIT License
3.68k stars 995 forks source link

__init__() got an unexpected keyword argument 'size' #57

Closed moghadas76 closed 2 years ago

moghadas76 commented 3 years ago

I could fix it. The problem is because of the 'gensim' versioning

kevinkorfmann commented 3 years ago

Which gensim version do you have installed to make it work?

nimasteryang commented 3 years ago

Which gensim version do you have installed to make it work?

use 3.6

moghadas76 commented 3 years ago

3.6

jiang13021 commented 2 years ago

I've got this TypeError, too.

gensim.models.Word2Vec's init() in version 3.6.0 is

def __init__(
            self, sentences=None, corpus_file=None, vector_size=100, alpha=0.025, window=5, min_count=5,
            max_vocab_size=None, sample=1e-3, seed=1, workers=3, min_alpha=0.0001,
            sg=0, hs=0, negative=5, ns_exponent=0.75, cbow_mean=1, hashfxn=hash, epochs=5, null_word=0,
            trim_rule=None, sorted_vocab=1, batch_words=MAX_WORDS_IN_BATCH, compute_loss=False, callbacks=(),
            comment=None, max_final_vocab=None,
        ):

My gensim version is 3.6.0.
As you can see, there are no two parameter names ”size“ and ”iter“.

I think "size" should be "vector_size" and the "iter" should be "epoch". Here's the comment on parameter "vector_size" and "epoch"

vector_size : int, optional
            Dimensionality of the word vectors.

epochs : int, optional
            Number of iterations (epochs) over the corpus. (Formerly: `iter`)
nawar-talal commented 8 months ago

jiang13021

AttributeError: 'Doc2Vec' object has no attribute 'iter'