I am trying to predict image classes in keras (binary classification). The exact accuracy of the model, but it seems that ImageDataGenerator mixing input images, so I could not match the predicted class with the original images.
datagen = ImageDataGenerator(rescale=1./255) generator = datagen.flow_from_directory( pred_data_dir, target_size=(img_width, img_height), batch_size=32, class_mode=None, shuffle=False, save_to_dir='images/aug'.format(feature)) print model.predict_generator(generator, nb_input)
For example, if I have a1.jpg , a2.jpg , ..., a9.jpg in pred_data_dir , I expect to get an array like
[class for a1.jpg, class for a2.jpg, ... class for a9.jpg]
from model.predict_generator() , but actually I got something like
[class for a3.jpg, class for a8.jpg, ... class for a2.jpg]
How can i solve the problem?
source share