Pickle,Tensorflow和UnicodeDecodeError:'utf-8'编解码器无法解码位置0的字节0x80:无效的起始字节

时间:2018-07-27 18:08:06

标签: tensorflow unicode

我正在尝试运行Tensorflow模型以进行微小的面部检测。但是,加载泡菜文件时,我无法克服UnicodeDecodeError的问题。

我按照回购所描述的方式制作了一个泡菜,即将模型从Matlab转换为Python。

我尝试了不同的Python版本,即Anaconda Python2和3,酿造了python 3。

这是仓库:

https://github.com/cydonia999/Tiny_Faces_in_Tensorflow

这是错误:

Traceback (most recent call last):
File "tiny_face_eval.py", line 227, in <module>
main()
File "tiny_face_eval.py", line 224, in main
lw=args.line_width, display=args.display)
File "tiny_face_eval.py", line 82, in evaluate
model = tiny_face_model.Model(weight_file_path)
File     "/Users/tvision/Desktop/Tiny_Faces_in_Tensorflow/tiny_face_model.py", line     24, in __init__
self.mat_blocks_dict, self.mat_params_dict = pickle.load(f)
File "/anaconda3/envs/py27/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/anaconda3/envs/py27/lib/python2.7/pickle.py", line 863, in load
key = read(1)
File "/anaconda3/envs/py27/lib/python2.7/codecs.py", line 314, in decode (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0: invalid start byte

0 个答案:

没有答案