TypeError: __init__() got an unexpected keyword argument 'size'import logging
代码段如下
import logging import os from gensim.models import word2vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) sentences = word2vec.LineSentence('./in_the_name_of_people_segment.txt') model = word2vec.Word2Vec(sentences, hs=1,min_count=1,window=3,size=100)
问了gpt,我的gensim的版本是4.2.0,高于4.0.0即可,但是仍然解决不了问题,
最后去官网,发现经过版本更新,换成了vector_size,修改size为vector_size即可
标签:__,TypeError,logging,argument,unexpected,import,size From: https://www.cnblogs.com/yhkdw/p/18193586