how to test model .h5

Viewed 14

I want to test model enter image description here

result: TypeError:listdir: path should be string, bytes,os.PathLike, integer or None, not DirectoryIterator

1 Answers

you have imported images and labels once by the Image Data Generator and flow from directory in the fifth code block based on the image.

so for the model evaluation, you would just implement test_set in the new_model.evaluate(test_set) and not needed to implement flow from directory and with test_set variable, cause of this variable dedicated to (images, labels) that have been imported before, and strongly wrong.

so just change your code in the last block into new_model.evaluate(test_set)

Related