Skip to content

Bug: TqdmCallback does not work with fit_generator #869

@CorwinTanner

Description

@CorwinTanner

Problem

fit_generator() passes batch_size=None in params resulting in an exception:

~/.pyenv/versions/3.7.5/envs/ratings/lib/python3.7/site-packages/tqdm/keras.py in on_epoch_begin(self, *_, **__)
     69                 self.batch_bar = self.tqdm_class(
     70                     total=total, unit='batch', leave=True,
---> 71                     unit_scale=1.0 / params('batch_size', 1))
     72                 self.on_batch_end = self.bar2callback(
     73                     self.batch_bar,

TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'

Categories

  • exception-raising bug

Version

4.41.0 3.7.5 (default, Dec  4 2019, 14:49:32) 
[GCC 7.3.1 20180712 (Red Hat 7.3.1-6)] linux

Example

model.fit_generator(
    sequence,
    epochs=5,
    callbacks=[
        TqdmCallback(verbose=2),
    ]
);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions