天天看點

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start bytewen報錯

利用tensorflow跑目标檢測代碼時遇見标題所述錯誤,解決方法:

image_data = tf.gfile.FastGFile(filename, 'r').read()

改為:

image_data = tf.gfile.FastGFile(filename, 'rb').read()