Recently, when training your own dataset, training is always interrupted, and an error prompt
Expected image (JPEG, PNG, or GIF), got unknown format starting with '\000\000\000\001Bud1\000\000 \000\000\000\010\000'
According to the error message prompt, when reading local files in the Python language, the picture folder contains files in non -JPEG, PNG, GIF format, which causes invalid reading.
Just delete the non -JPEG, PNG, GIF format files in the folder. However, after I checked many times, I still found no other documents, but each training still reported an error. Finally, I had a clever movement and tried to traverse each picture in the read folder. When reading the non -picture file, an error will be reported. Finally, the error will be reported. Delete, it feels painful. Essence Essence Essence Essence
import os
import tensorflow as tf
from PIL import Image
# Image saving address
path = "D:/picture/"
num = 1 # Name variable
for file in os.listdir(path + 'A'):
image = Image.open("D:/pictur/A/"+ file)
for file in os.listdir(path + 'B'):
image = Image.open("D:/pictur/B/"+ file)