Weirdness with fit_generator in Keras 2.0


(Alec Rubin) #1

I’m having a really weird issue ever since upgrading to Keras 2.0. I’m using a very basic convolutional neural net and for some reason when using fit_generator() I am unable to get the model to train. But, if i save the outputs from the generators to a bcolz file, and then run model.fit() instead of model.fit_generator(), the model is able to train normally. I am using the default parameters for the generator function, and compiling my model with the Adam optimizer at a learning rate of 1e-4. I’ve been trying to figure this out for well over a day now, and have had no luck. Has this happened to anyone else?


(Dennis Sakva) #2

What do you mean by “I am unable to get the model to train”. Does it produce an exception? Not learning anything?


(Alec Rubin) #3

Sorry, the model works without any exceptions, but the accuracy remains constant over time. It doesn’t predict the exact same thing each time, but it is roughly whatever a random guess would be. For example predicting two classes will range between 45-55% while predicting 10 classes will range between 8-12%.