EOFError: unexpected end of input; is count incorrect or file otherwise damaged?
报错代码:
import gensimwv_from_text = gensim.models.KeyedVectors.load_word2vec_format('C:/ChineseEmbeddingMin.txt', binary=False)
完整报错:
Traceback (most recent call last):File "E:/tecentWordsTest.py", line 9, in <module>wv_from_text = gensim.models.KeyedVectors.load_word2vec_format('C:/ChineseEmbeddingMin.txt', binary=False)File "D:\python3.6\lib\site-packages\gensim\models\keyedvectors.py", line 1632, in load_word2vec_formatlimit=limit, datatype=datatype, no_header=no_header,File "D:\python3.6\lib\site-packages\gensim\models\keyedvectors.py", line 1913, in _load_word2vec_format_word2vec_read_text(fin, kv, counts, vocab_size, vector_size, datatype, unicode_errors, encoding)File "D:\python3.6\lib\site-packages\gensim\models\keyedvectors.py", line 1817, in _word2vec_read_textraise EOFError("unexpected end of input; is count incorrect or file otherwise damaged?")
EOFError: unexpected end of input; is count incorrect or file otherwise damaged?
原因:
词向量文件中的第一行是两个数字,第一个表示此文件中共有词多少,不是行数(因为这个数和词的数量对不上才报了上边的错);第二个是词向量的维度
解决办法:
ctrl+End找到文件最底部,看看共有多少行,再减掉第一行,就是词的数量,把第一行的第一个数改成这个就好了
EOFError: unexpected end of input; is count incorrect or file otherwise damaged?相关推荐
- 【gensim问题记录】EOFError: unexpected end of input; is count incorrect or file otherwise damaged?
参考博客 报错信息: 打开词向量文件 vi glove.840B.300d.word2vec.txt 词向量文件中的第一行是两个数字,第一个表示此文件中共有词多少:第二个是词向量的维度 输入crtl+ ...
- package main: read unexpected NUL in input
package main: read unexpected NUL in input 我的问题: go build -o wfs_server wfs_server_lite.go wfs_webso ...
- java.io.eof_java.io.IOException: java.io.EOFException: Unexpected end of input stream错误
报错现象: Diagnostic Messages for this Task: Error: java.io.IOException: java.io.EOFException: Unexpecte ...
- EOFError: Ran out of input
项目场景:对于序列化字节文件读取数据时 import pickle db = pickle.load(dbfile) 问题描述:文件操作模式匹配问题 EOFError: Ran out of inpu ...
- unexpected symbol、unexpected end of input
unexpected symbol.unexpected end of input 问题: # 不是一个合法的表达式(expression) parse(text = "2^") ...
- spray.json.JsonParser$ParsingException: Unexpected end-of-input at input index
完整报错如下: Exception in thread "main" spray.json.JsonParser$ParsingException: Unexpected end- ...
- python异常之EOFError: Ran out of input
python异常之EOFError: Ran out of input 参考文章: (1)python异常之EOFError: Ran out of input (2)https://www.cnbl ...
- hadoop异常: java.io.EOFException: Unexpected end of input stream
hadoop异常: java.io.EOFException: Unexpected end of input stream 参考文章: (1)hadoop异常: java.io.EOFExcepti ...
- 浏览器报错:unexpected end of input 解决方法
浏览器报错:unexpected end of input 解决方法 参考文章: (1)浏览器报错:unexpected end of input 解决方法 (2)https://www.cnblog ...
- (已解决)EOFError: Ran out of input
如图所示. 这个问题是因为pickle.load()读取的文件为空导致,加个容错: <EOFError: Ran out of input>
最新文章
- .NET框架程序设计-.NET框架开发平台的体系架构概览(.NET程序本质)
- JQ无法修改input的type属性的替代解决方法
- aptitude命令的使用
- springboot oauth2登录成功处理器_Spring Boot Security 整合 OAuth2 设计安全API接口服务...
- Spring Boot 应用监控:Actuator与 Admin
- 窗口分析函数_10_计算组总和的占比
- 每天五分钟,玩转Docker。-Day2
- python打开指定路径的excel_python使用相对定位,绝对定位,选取同级别文件下的指定文件(csv,excel)...
- python 分布式存储_Amazon S3 分布式存储的 python 接口实现
- as4配置本地gradle_Gradle和Maven的区别
- Python3爬虫项目集:豆瓣电影排行榜top250
- 如何批量将 Word 文档转为 XPS 格式
- 利用WinRAR自解压功能制作独立exe 程序
- Maven镜像仓库替换为阿里云镜像仓库
- matlab 打开xls文件,matlab中读取excel的xls文件
- 条款30:透彻了解inlining的里里外外
- 阿里巴巴校园招聘在线面试之附加题
- Word操作技巧大全1(转)
- java浅谈线程安全之锁
- 计算机触摸屏维修,工控触摸屏常见的故障问题和维修方法分别是什么
热门文章
- 正斜杠“/”、反斜杠“\、”转义字符“\”、文件路径分割符傻傻记不清楚
- CKMLCP 相关报错处理
- COPA获利能力分析【02特征派生和值字段评估】
- 公开课讲师雷茂锋:微信为企业号量身定制接口能力
- hibernate mysql 关联查询_查询hibernate条件
- 鲁宾逊数学理论,在我国阔步前进!
- Layui中表格,表单,选项卡总结
- 在已有OpenStack集群中部署Manila(三):基于模式一使用Manila
- C++前缀和算法的应用:摘水果 原理源码测试用例
- RocketMQ消息消费三:负载均衡