解决方法

将报错的

from gensim.models import Word2Vecmodel = Word2Vec.load_word2vec_format('test.bin.gz', binary=True)

替换为:

from gensim.models import KeyedVectorsmodel = KeyedVectors.load_word2vec_format('test.bin.gz', binary=True)

其他替换

KeyedVectors.load_word2vec_format instead of Word2Vec.load_word2vec_format
word2vec_model.wv.save_word2vec_format instead of
word2vec_model.save_word2vec_format
model.wv.syn0norm instead of model.syn0norm
model.wv.syn0 instead of model.syn0
model.wv.vocab instead of model.vocab
model.wv.index2word instead of model.index2word

解决gensim报错AttributeError: type object ‘Word2Vec‘ has no attribute ‘load_word2vec_format‘相关推荐

  1. unittest-ddt报错AttributeError: type object ‘forTestDDT‘ has no attribute ‘test_2‘

    unittest 添加多个ddt数据驱动后,报错: FAILED (errors=1)Error Traceback (most recent call last):File "D:\Ana ...

  2. python 报错 AttributeError: type object ‘datetime.datetime‘ has no attribute ‘datetime‘

    python报错:type object 'datetime.datetime' has no attribute 'datetime' 描述:在第一个python程序里还未报错,第二个程序完全复制过 ...

  3. 【Flask】flask-bootstrap报错AttributeError: module ‘dominate.tags‘ has no attribute ‘input‘解决方法

    问题 在使用flask-bootstrap渲染表单时,报错AttributeError: module 'dominate.tags' has no attribute 'input'. 解决方法 修 ...

  4. etree.html 报错 AttributeError:‘function’ object has no attribut ‘HTML’

    etree.html 报错 1.Pycharm 中lxml没有etree模块的解决方法: 之前是: from lxml import etree tree = etree.HTML( ) python ...

  5. Scrapy爬虫报错AttributeError: ‘NoneType‘ object has no attribute ‘write‘

    前言 一.报错 AttributeError: 'NoneType' object has no attribute 'write' 二.报错原因 1.piplines文件中的方法不能自定义的呢 开始 ...

  6. 关于在《python编程从入门到实践》书中练习“外星人大战”报错“AttributeError: ‘AlienInvasion‘ object has no attribute ‘blit‘”

    关于在<python编程从入门到实践>书中练习"外星人大战"报错"AttributeError: 'AlienInvasion' object has no ...

  7. 爬虫的自创建请求对象:报错AttributeError: 'str' object has no attribute 'items'

    在使用爬虫库创建自定义请求对象时 将值传入headers agent = random.choice(userAgent) REQ = request.Request(url,headers=agen ...

  8. 运行项目时flask_sqlalchemy报错AttributeError: ‘LocalStack‘ object has no attribute ‘__ident_func__‘

    运行项目时flask_sqlalchemy报错AttributeError: 'LocalStack' object has no attribute '__ident_func__' 1.原因 2. ...

  9. 关于AttributeError: type object ‘XXX‘ has no attribute ‘XXX‘的问题

    关于AttributeError: type object 'XXXXXX' has no attribute 'name'的报错的原因,先运行运行一段代码 例如: class Person(obje ...

最新文章

  1. Python学习(变量与字符串)
  2. linux设置套接字缓冲区的大小
  3. 图解JVM的Class文件格式(详细版)
  4. 元宵节快乐 | 2月15日 星期二 | 携程在国内率先开启混合办公模式;米哈游推出元宇宙品牌;AMD宣布完成对赛灵思的收购...
  5. 基于FPGA的红外遥控解码与PC串口通信
  6. python编写win 本地reader程序_使用Python、win32api和Acrobat Reader 9打印PDF
  7. 使用 MIDP 底层用户接口 API
  8. PyCharm报错ModuleNotFoundError: No module named requests
  9. java插件不启动_java-插件安装后Eclipse启动问题
  10. Kali扫描 vega的使用
  11. 使用Android Studio打包遇到的问题
  12. 怎么把ppt文字大小设置一致_51页PPT告诉你,大神都在用的这些神级插件,到底有多赞?...
  13. Unity项目-黑魂复刻(四)玩家控制器(翻滚以及跳跃操作改动)
  14. BUUCTF-web极客大挑战
  15. 北京工商大学计算机专业校友评价,北京工商大学英语校友返校聚会
  16. hacking 麦步手表之(4)制作一个大数字表盘xzy-big-number
  17. 基于Linux的网络编程——网络聊天程序
  18. 如何彻底卸载绿盟终端DLP
  19. 你真的会做小程序按钮吗?看了字节35K前端的样式设计,悟了
  20. SnnGrow快讯:微软被曝整合ChatGPT进必应向谷歌宣战?、消息称微软将把OpenAI人工智能技术整合至Office:或可编写电子邮件、学校封杀,大厂禁用,ChatGPT引发大面积恐慌?

热门文章

  1. wrodpress登录mysql_登陆wordpress后台MySQL错误
  2. python学习之老男孩python全栈第九期_数据库day004 -- 作业
  3. Rock8247 bsp-Tornado-VXWorks Build up
  4. visual studio installer 卸载时不能删除安装目录问题
  5. android在activity中锁屏解锁后重走OnCreate的问题的解决办法
  6. 走上这条路,也许是缘份
  7. liunx 下的动态地址分配服务DHCP
  8. python3简单代码_python3实现简单汉诺塔的代码教程
  9. 可以发外链的网站_可以发外链的地方有哪些?-top推
  10. python控制鼠标_如何使用Python在Mac中控制鼠标?