TimeStopping Callback fail in verbose mode
See original GitHub issueSystem information
OS Platform and Distribution (Ubuntu 19.04): TensorFlow version and how it was installed (pip==2.1.0): TensorFlow-Addons version and how it was installed (pip==0.7.0): Python version: 3.7 Is GPU used? (yes):
Describe the bug
When the fit method stop before the timer, it raises with
AttributeError: 'TimeStopping' object has no attribute 'stopped_epoch'
Code to reproduce the issue
Use tqdm callback
Other info / logs
Proposed fix
...
def on_epoch_end(self, epoch, logs={}):
self.stopped_epoch = epoch
if time.time() >= self.stopping_time:
self.model.stop_training = True
...
def on_train_end(self, logs=None):
if self.verbose > 0:
formatted_time = datetime.timedelta(seconds=self.seconds)
msg = "Stopping at epoch {} after training for {}".format(
self.stopped_epoch + 1, formatted_time
)
print(msg)
...
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
tfa.callbacks.TimeStopping - Addons
Stop training when a specified amount of time has passed.
Read more >How do I use the Tensorboard callback of Keras?
This line creates a Callback Tensorboard object, ... step 5 : Open Terminal in your working directory and type the command below.
Read more >Stop Training after Certain Time in TensorFlow 2
The TimeStopping callback is provided as TensorFlow add-on. It can be installed using pip package manager from the command line.
Read more >Index - Everything curl
Debug callback. , All easy options. All easy options. , Trace everything. Trace everything. . CURLOPT_DNS_CACHE_TIMEOUT: Caching. Caching.
Read more >Ubuntu Manpage: mpv - a media player
Some demuxers fail to seek to a keyframe before the given target position ... -v Increment verbosity level, one level for each -v...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
#967 is a quick workaround to avoid crashes. It does its job very well but now we should move forward to a comprehensive solution, because for example https://github.com/tensorflow/addons/pull/967#issuecomment-579628853. It’s still #964, I think we should stay here.
Closing this issue as @failure-to-thrive’s PR has been merged, thanks!