Unicode解码错误:'ascii'编解码器无法解码位置 0 中的字节0xdb:序号不在范围内(128)



当我当时使用pickle.load加载文件时,我将面临此错误。

with open("tfidf_vectorizer", mode='r+b') as handle:                            
    tfidf_vectorizer = pickle.load(handle)

unicodedecodeerror:'ascii'编解码器无法解码字节0xdb。 0:序数不在范围内(128(

在读取文件时尝试设置编码。

ex:

with open("tfidf_vectorizer", mode='r+b', encoding='utf-8') as handle:                            
    tfidf_vectorizer = pickle.load(handle)

最新更新