我在尝试将阿拉伯文本存储在变量中时遇到了问题。这是代码:
# load the train data & store it..
with open('files/0007.txt', 'rb') as f:
train_data = pickle.load(f)
错误:
UnpicklingError Traceback (most recent call last)
<ipython-input-5-fa360e8454ee> in <module>
1 # load the train data & store it in a file
2 with open('files/0007.txt','rb') as f:
----> 3 train_data=pickle.load(f)
UnpicklingError: invalid load key, '\xd8'.
发布于 2021-03-14 15:02:38
Reason : file is corrupted
尝试压缩文件,上传它,然后在会话中解压。当您上传/下载该文件时,似乎没有正确保存该文件。
https://stackoverflow.com/questions/66625910
复制