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.

Can I use callbacks in train_on_batch ?

See original GitHub issue

@fchollet As we all know, Keras provide a callbacks interface in model.fit() function. However, it requires loading the training dataset into memory previously. When I use train_on_batch( ), I didn’t find out where I can put my callbacks (e.g. EarlyStopping, History, etc.). Any suggestions ?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:11
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

45reactions
naotokuicommented, Feb 6, 2017

what about TensorBoard callback? Are there any way to use TensorBoard with train_on_batch()?

37reactions
fcholletcommented, Aug 6, 2015

Clearly if you are training on each batch from inside your own script, then the notion of per-batch or per-epoch callback is not longer relevant. You are free to do whatever you want between batches or between epochs: it’s your own code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keras callbacks with train_on_batch? - Stack Overflow
Is there any way to use the keras callbacks when using train_on_batch? I prefer not writing the fit loop from scratch.
Read more >
Writing your own callbacks - Keras
A callback is a powerful tool to customize the behavior of a Keras model during training, evaluation, or inference. Examples include tf.keras.
Read more >
How to use Tensorboard callback in Keras? - AI Pool
I'm using Keras 2.1.* and wanted to use Tensorboard for it. How can I use it, when I don't call fit function? I'm...
Read more >
Using checkpoint saving with train_on_batch in Keras? - Reddit
I'm training my data in batches using train_on_batch, but it seems train_on_batch doesn't have an option to use callbacks- which seems to be ......
Read more >
FAQ - Keras Documentation
How can I use Keras with datasets that don't fit in memory? ... You can do batch training using model.train_on_batch(X, y) and model.test_on_batch(X,...
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