亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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

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

嗶嗶one 2019-04-16 20:27:55
本人使用python3.4,win764位操作系統,當6"""loadsinglebatchofcifar"""7withopen(filename,'r')asf:---->8datadict=pickle.load(f)9X=datadict['data']錯誤信息是UnicodeDecodeError:'gbk'codeccan'tdecodebyte0x80inposition0:illegalmultibytesequence我把line7改成了6"""loadsinglebatchofcifar"""7withopen(filename,'r',encoding='utf-8")asf:---->8datadict=pickle.load(f)9X=datadict['data']311#decodeinput(takingthebufferintoaccount)312data=self.buffer+input-->313(result,consumed)=self._buffer_decode(data,self.errors,final)314#keepundecodedinputuntilthenextcall315self.buffer=data[consumed:]錯誤的最終指向了Python34\lib\codecs.pyindecode(self,input,final)。錯誤信息是UnicodeDecodeError:'utf-8'codeccan'tdecodebyte0x80inposition0:invalidstartbyte。請問具體是編解碼哪塊出了問題,怎么解決?
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 440 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號