ubuntu pickle.load保存模型UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
时间: 2023-10-21 11:04:09 浏览: 174
-pickle.PicklingError: Can't pickle <function... pycharm2023运行报错
根据引用,报错信息是UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte,说明在解码时遇到了无效的起始字节。根据引用,尝试了多种编码格式但仍然报错,最后使用了encoding='iso-8859-1'来解决问题。而根据引用,报错的位置是在pickle.load(open(fname_or_dict))这行代码,说明在反序列化模型文件时出错。 综上所述,根据错误信息和引用内容,解决这个问题的方法是使用encoding='iso-8859-1'参数来打开模型文件并进行反序列化操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0x80 in position 0: invalid start byte](https://blog.csdn.net/qq_43900236/article/details/120986032)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0x80 in position 0: invalid start byte解决...](https://blog.csdn.net/qq_41175546/article/details/121468913)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文