Closed moghadas76 closed 2 years ago
Which gensim version do you have installed to make it work?
Which gensim version do you have installed to make it work?
use 3.6
3.6
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`)
AttributeError: 'Doc2Vec' object has no attribute 'iter'
I could fix it. The problem is because of the 'gensim' versioning