Question:I’m trying to implement a RandomizedSearchCV using the ImageDataGenerators.
Here an example of the generator used for the train set:
validation_generatorand finally the model has been fitted as:
KerasClassifierwhich wraps the model for sklearn and
param_distribsis the dictionary with the hyperparameters values.
Finally I fitted the RandomizedSearchCV object as follows:
Answer:I don’t recommend the below solution and approch. I highly recommend using
KerasTunerbut If you want to input
RandomizedSearchCVyou need to extract
DirectoryIteratorthen input them to RandomizedSearchCV like below:
If you have better answer, please add a comment about this, thank you!