'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
原因很多:
有一种情况是,文件是gb2312编码,解决方法是转为utf-8编码
'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
错误写法:
image_data = tf.gfile.FastGFile(image, 'r').read()
解决:
#读取图片
image_data = tf.gfile.FastGFile(image, 'rb').read()
参考:
https://stackoverflow.com/questions/42339876/error-unicodedecod