question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Keras fit_generator to train the model

See original GitHub issue

It might be useful to use generator, see example here to train the model.

We should also add callback_list while training e.g. ModelCheckpoint, EarlyStopping, ReduceLROnPlateau to fit_generator function in order to save the best model (divide training set into training and development set).

I can work on it and send the PR over the weekend 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rkcosmoscommented, Jul 1, 2017

notebook is still running on my local computer, but other small changes are done. So you can implement fit_generator and call_back on top of current code. I think fit_generator can be structured similar to this (https://github.com/rkcosmos/Breast-Cancer/blob/master/src/inception1_simplified.ipynb). We would need a function like ‘organise training set section’ to separate train and test folder. Then fit_generator can do its job naturally.

0reactions
titipatacommented, Jul 3, 2017

I think I’ll close the issue for now and we can take into account the fit_generator later once the training data is much larger (e.g. we want to incorporate Wikipedia). The version that we have currently using fit is pretty easy to read.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Keras fit and fit_generator (a hands-on tutorial)
The .fit_generator function accepts the batch of data, performs backpropagation, and updates the weights in our model. This process is repeated ...
Read more >
keras.fit() and keras.fit_generator() - GeeksforGeeks
.fit is used when the entire training dataset can fit into the memory and no data augmentation is applied. .fit_generator is used when...
Read more >
Use a generator for Keras model.fit_generator - Stack Overflow
It uses random data, so trying to teach NN on it makes no sense, but it's a good illustration of using a python...
Read more >
A detailed example of how to use data generators with Keras
As you can see, we called from model the fit_generator method instead of fit , where we just had to give our training...
Read more >
How to use Keras fit and fit_generator in Python - Value ML
We will learn the working of Keras .fit and .fit_generator functions, along with their ... We can use Keras fit function for training...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found