Skip to content

support for initial_epoch in keras TqdmCallback #1138

@fabiocarrara

Description

@fabiocarrara
  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
    • documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
    • new feature request
  • I have visited the source website, and in particular read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and evnironment, where applicable:

version 4.59.0, Google Colab

Would love the keras TqdmCallback to support initial_epochs in keras .fit() call to correctly initialize the starting point of the progress bar when resuming training.

Passing the initial epoch using initial kwarg does not seem to work, as it is not considered in on_train_begin().

tqdm/tqdm/keras.py

Lines 69 to 73 in bcce20f

def on_train_begin(self, *_, **__):
params = self.params.get
auto_total = params('epochs', params('nb_epoch', None))
if auto_total is not None:
self.epoch_bar.reset(total=auto_total)

Colab Gist reproducing the problem:
https://colab.research.google.com/gist/fabiocarrara/3f81bed4bc735291205b1b42fd5c1567/untitled1.ipynb

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions