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.

Feature Request in Layers: Store best model with save_best_only.

See original GitHub issue

TensorFlow.js version

0.10.3

Browser version

Latest Chrome

Describe the problem or feature request

When training on a just a few samples as usually happens in the browser, training and validation loss tend to jump around a bit.

It would be great if we could automatically get the best model after training finishes.

This is possible in Keras with the ModelCheckpoint(save_best_only=True) callback and afterwards loading the weights from that saved file.

Alternatively, if I knew how to copy a model in its current state, it would be straightforward to write the logic for this in a onEpochEnd callback.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
bileschicommented, May 16, 2018

Great suggestion! FYI, model copying is coming soon. Please follow https://github.com/tensorflow/tfjs-core/pull/1038 for guidance on that front.

0reactions
google-ml-butler[bot]commented, Jul 10, 2021

Closing as stale. Please @mention us if this needs more attention.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf.keras.callbacks.ModelCheckpoint | TensorFlow v2.11.0
Whether only weights are saved, or the whole model is saved. Note: If you get WARNING:tensorflow:Can save best model only with <name> available, ......
Read more >
How to keep a list of models saved during training (save best ...
Since I am using "save best only" it will save only certain epochs. I want to collect the paths of actually saved models...
Read more >
Keras Callbacks and How to Save Your Model from Overtraining
In this article, you will learn how to use the ModelCheckpoint callback in Keras to save the best version of your model during...
Read more >
How to Checkpoint Deep Learning Models in Keras
Checkpoint Best Neural Network Model Only. A simpler checkpoint strategy is to save the model weights to the same file if and only...
Read more >
Master's Thesis - Pure - Eindhoven University of Technology
Feature request in layers : Store best model with save best only. · issue 296 · tensorflow/tfjs, Jul 2018. 54. Visualizing convolutional neural...
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