ML常见错误及原因
一、编码问题1、读入文件编码问题报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 5251: illegal multibyte sequence代码:fr =open(file_path,'r')#从语料库文件中读取数据并统计词频lines = fr.readlines()办法:fr =open(file_path,'r',encoding = 'utf-8')PS:被引入的文...
原创
2021-02-23 22:50:42 ·
476 阅读 ·
0 评论