Tuesday, September 22, 2020

Using model.fit() instead of fit_generator() with Data Generators - TF.Keras

If you have been using data generators in Keras, such as ImageDataGenerator for augment and load the input data, then you would be familiar with the using the *_generator() methods (fit_generator(), evaluate_generator(), etc.) to pass the generators when trainning the model. 

But recently, if you have switched to TensorFlow 2.1 or later (and tf.keras), you might have been getting a warning message such as,

Model.fit_generator (from tensorflow.python.keras.engine.training) is deprecated and will be removed in a future version.
Instructions for updating:
Please use Model.fit, which supports generators.

Or,

Model.evaluate_generator (from tensorflow.python.keras.engine.training) is deprecated and will be removed in a future version.
Instructions for updating:
Please use Model.evaluate, which supports generators.


fit_generator() Deprecation Warning
fit_generator() Deprecation Warning

This is because in tf.keras, as well as the latest version of multi-backend Keras, the model.fit() function can take generators as well. 

Wednesday, September 16, 2020

Major Update on My New Book: Deep Learning on Windows

If you recall, I originally intended to incrementally release my new book - Deep Learning on Windows – and have it completed around the June/July timeframe. Well, the month of July came and went, but no book got released. I also was not posting articles in the blog frequently for the past couple of months.

This was due to a major change in the plan for the book.

Deep Learning on Windows was picked up by a publisher!

The book will now be published under Apress, and it became a much larger offering than what I initially envisioned.

The new cover for the book is shown below:

New Cover for Deep Learning on Windows
New Cover for Deep Learning on Windows


On late-May, while I was working on the first drafts of the book on LeanPub, I was contacted by Apress on whether I would be interested in publishing the book under Apress banner.