TypeError:empty():argument ‘size‘ must be tuple of ints, but found element of type Word2Vec at pos 2

本文解决了在使用Word2Vec时遇到的TypeError,参数'size'必须为整型元组,但发现元素类型为Word2Vec的问题。通过将参数改为整型,成功解决了报错。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错:TypeError: empty(): argument ‘size’ must be tuple of ints, but found element of type Word2Vec at pos 2

原因:参数类型不对,应该是整形int

解决:改成整形即可