当我使用 pickle.load 加载文件时,我遇到了这个错误 .
pickle.load
with open("tfidf_vectorizer", mode='r+b') as handle: tfidf_vectorizer = pickle.load(handle)
UnicodeDecodeError:'ascii'编解码器无法解码位置0的字节0xdb:序号不在范围内(128)
尝试在读取文件时设置编码 .
Ex:
with open("tfidf_vectorizer", mode='r+b', encoding='utf-8') as handle: tfidf_vectorizer = pickle.load(handle)
1 回答
尝试在读取文件时设置编码 .
Ex: