python codec_python 3.4中,'gbk' codec can't decode byte 0x80 in position 0

本人使用python 3.4,win7 64位操作系统,当

6 """ load single batch of cifar """

7 with open(filename, 'r') as f:

----> 8 datadict = pickle.load(f)

9 X = datadict['data']

错误信息是UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 0: illegal multibyte sequence

我把line 7 改成了

6 """ load single batch of cifar """

7 with open(filename, 'r',encoding='utf-8") as f:

----> 8 datadict = pickle.load(f)

9 X = datadict['data']

311 # decode input (taking the buffer into account)

312 data = self.buffer + input

--> 313 (result, consumed) = self._buffer_decode(data, self.errors, final)

314 # keep undecoded input until the next call

315 self.buffer = data[consumed:]

错误的最终指向了 Python34\lib\codecs.py in decode(self, input, final)。

错误信息是UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte。

请问具体是编解码哪块出了问题,怎么解决?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值