UnicodeDecodeError:'ascii'编解码器无法解码位置0的字节0xcc:序数不在范围内(128)

时间:2018-07-17 01:49:59

标签: python-3.x encoding pickle

我使用Python3.6,此代码发生错误

with open('val_image_id2feature.pkl', 'rb') as f:
    val_image_id2feature = pickle.load(f)
  

UnicodeDecodeError:“ ascii”编解码器无法解码位置0的字节0xcc:序数不在范围内(128)

如果我按如下方式添加encoding='latin1'encoding='bytes',则会出现新问题

with open('val_image_id2feature.pkl', 'rb') as f:
    val_image_id2feature = pickle.load(f, encoding='latin1')
  

_pickle.UnpicklingError:泡菜数据被截断

如何处理?

0 个答案:

没有答案