mean() got an unexpected keyword argument 'min_count'
时间: 2023-09-30 08:01:58 浏览: 218
Error Encountered an improper argument
问题出现在运行word2vec_train自定义函数中,提示TypeError: init() got an unexpected keyword argument ‘size’和mean() got an unexpected keyword argument 'min_count'。根据引用和引用的内容,出现这个错误的原因是gensim库的版本存在差异,导致传入的参数格式不一致。
解决方案有两种:
1. 将传入参数格式进行修改,将size改为vector_size,将iter改为epochs。
2. 降低gensim库的版本,以便与代码中的参数一致。
请根据实际情况选择其中一种方案进行修改。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* *2* [【Python异常】TypeError: __init__() got an unexpected keyword argument ‘size‘与gensim.models.word2...](https://blog.csdn.net/weixin_43529465/article/details/124546121)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *3* [解决TypeError: __init__() got an unexpected keyword argument ‘iter‘的问题](https://blog.csdn.net/PIG_RABBIT/article/details/122910443)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文