keras model.fit_generator() several times slower than model.fit()
You may want to check out the workers
and max_queue_size
parameters of fit_generator()
in the documentation. Essentially, more workers
creates more threads for loading the data into the queue that feeds data to your network. There is a chance that filling the queue might cause memory problems, though, so you might want to decrease max_queue_size
to avoid this.