keras model.fit_generator() several times slower than model.fit()

0 votes
In Keras 1.2.2, there are referencing merge and it has multiprocessing included, but model.fit_generator() is still about 4-5x slower than model.fit() due to disk reading speed limitations. How can this be sped up, say through additional multiprocessing?

Can anyone help me with this?
May 31, 2019 in Python by ana1504.k
• 7,890 points
1,113 views

1 answer to this question.

0 votes
You may want to check out the workers and max_queue_size parameters of fit_generator() in the documentation. Essentially, more workers create 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.
answered May 31, 2019 by SDeb
• 13,250 points

Related Questions In Python

+1 vote
2 answers

Replace every character of string by character whose ASCII value is K times more than it

Refer below code for your problem statement def ...READ MORE

answered May 17 in Python by Kumar Sambhawam

edited May 18 by Gitika 2,454 views
0 votes
1 answer

How to get all related Django model objects in Python?

This actually gives you the property names ...READ MORE

answered Nov 14, 2018 in Python by Nymeria
• 3,520 points

edited Dec 18, 2018 by Nymeria 2,557 views
0 votes
1 answer

How to fit a histogram using Python?

Here is an example working on py2.6 ...READ MORE

answered Dec 26, 2018 in Python by Nymeria
• 3,520 points
2,594 views
0 votes
1 answer

Tensorflow ImportError: cannot import name'abs' error

Hi@akhtar, You may get this error, if you ...READ MORE

answered Apr 23 in Machine Learning by MD
• 41,340 points
817 views
0 votes
1 answer
0 votes
1 answer

AttributeError: module 'coco' has no attribute 'CocoConfig'

Hi@akhtar, You need to import the coco module ...READ MORE

answered Jul 13 in Machine Learning by MD
• 41,340 points
49 views
+1 vote
1 answer

Index of predicted wrong data in Keras, how to find it?

Simply, use: model.predict() pred = model.predict(x_test) indices = [i for ...READ MORE

answered Sep 28, 2018 in Python by Priyaj
• 57,550 points
1,101 views
0 votes
1 answer

How to get rid of tensorflow verbose messages with Keras?

If you are using TensorFlow 0.12, you ...READ MORE

answered Jan 24, 2019 in Python by SDeb
• 13,250 points
1,512 views
0 votes
1 answer

Django model iterate fields

You can try the following: getattr(foo.__class__, <field_name>)   This should ...READ MORE

answered Apr 10, 2019 in Python by SDeb
• 13,250 points
1,507 views