Skip to content

ImageDataGenerator should have a verbosity argument #42681

@jondo

Description

@jondo

System information

  • TensorFlow version (you are using): 2.3.0
  • Are you willing to contribute it (Yes/No): No

Describe the feature and the current behavior/state.
When calling tensorflow.keras.preprocessing.image.ImageDataGenerator.flow_from_directory, currently a message like Found 1437 images belonging to 2 classes. is printed.

I suggest adding an optional keyword argument verbose with default setting verbose=1 to this function, such that verbose=0 suppresses this printed message. See e.g. the verbose keywords of tf.keras.Model.fit, or of the EarlyStopping or ModelCheckpoint callbacks.

Will this change the current api? How?
This will add an optional keyword argument.

Who will benefit with this feature?

  • Everyone who needs to call this function repeatedly in order to loop over different batch_size values during hyperparameter tuning. In this case, the repeated message is uninteresting and distracts from the interesting output and should therefore be omittable.
  • Everyone who upgraded from standalone Keras (which did not show this message, e.g. version 2.2.4), who wants to get the same output as before.

Metadata

Metadata

Labels

comp:kerasKeras related issuesstaleThis label marks the issue/pr stale - to be closed automatically if no activitystat:awaiting responseStatus - Awaiting response from authortype:featureFeature requests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions