New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Display wrong epoch on Keras resume training #1150
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #1150 +/- ##
==========================================
- Coverage 89.80% 89.76% -0.05%
==========================================
Files 26 26
Lines 1707 1710 +3
Branches 283 284 +1
==========================================
+ Hits 1533 1535 +2
- Misses 128 129 +1
Partials 46 46 |
tqdm/keras.py
Outdated
if self.epoch_bar.n < epoch: | ||
self.epoch_bar.update(epoch-self.epoch_bar.n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only ever triggered exactly once when training is resumed? Or are there any other circumstances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly once. I don't figure out other circumstances.
@@ -69,10 +69,12 @@ def __init__(self, epochs=None, data_size=None, batch_size=None, verbose=1, | |||
def on_train_begin(self, *_, **__): | |||
params = self.params.get | |||
auto_total = params('epochs', params('nb_epoch', None)) | |||
if auto_total is not None: | |||
if auto_total is not None and auto_total != self.epoch_bar.total: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid re-assigning the total when it is provided manually by the user.
f39dcbd
to
3f899b9
Compare
- set initial epochs - update tests
68d91f5
to
74ec622
Compare
This fix
TqdmCallback
showing wrong information about epochs when resume training withinitial_epoch != 0
as was reported on #1138The test has been provided but also the Colab example provided by @fabiocarrara here: