How to evaluate model while the data splitted manually in deep learning?



I split my dataset separated with my model file.
So in my model file, I just run the model and set which is train, val, and test.
My model already has good results, but I struggled when I want to evaluate and predict the model.

Here’s my code to set which is train, val, and test file.

train_datagen = ImageDataGenerator(

when I run this code

score = model.evaluate(train_generator, test_generator, verbose=1)

this error appeared

ValueError: `y` argument is not supported when using `keras.utils.Sequence` as input.

ValueError: y argument is not supported when using keras.utils.Sequence as input.

Here’s my full code:

Any hints?


I do not think you should be passing both your train_generator and test_generator when evaluating your model. Maybe try this:

score = model.evaluate(test_generator, verbose=1)

Unlike the the method that can take a training and a validation set, model.evaluate only accepts one set of inputs.

Answered By – AloneTogether

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More