Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Image data generator quiet mode? #304

Open
ConnorBarnhill opened this issue Jul 22, 2020 · 4 comments
Open

Image data generator quiet mode? #304

ConnorBarnhill opened this issue Jul 22, 2020 · 4 comments
Labels
image Related to images PR welcome

Comments

@ConnorBarnhill
Copy link

Is there any reason why there isn't a quiet mode for ImageDataGenerator.flow_from_dataframe? It's not ideal to see "Found {} non-validated image filenames." for every initialization.

@ConnorBarnhill ConnorBarnhill added the image Related to images label Jul 22, 2020
@Dref360
Copy link
Contributor

Dref360 commented Aug 3, 2020

There is no particular reason, would using the logging module good enough? You could disable the logs with an ENV var.

@jondo
Copy link

jondo commented Sep 3, 2020

As described in tensorflow/tensorflow#42681, flow_from_directory is also affected.

Instead of switching the message via an ENV var I suggest adding an optional keyword argument verbose with default setting verbose=1 to these functions, such that verbose=0 suppresses these printed messages See e.g. the verbose keywords of tf.keras.Model.fit, or of the EarlyStopping or ModelCheckpoint callbacks.

@Dref360
Copy link
Contributor

Dref360 commented Sep 3, 2020

Yes we can do that. PR welcome.

@jondo
Copy link

jondo commented Sep 4, 2020

According to the release notes, current Tensorflow 2.3.0 introduced a new Keras dataset generation utility (emphasis added):

image_dataset_from_directory is a utility based on tf.data.Dataset, meant to replace the legacy ImageDataGenerator. It takes you from a structured directory of images to a labeled dataset, in one function call. Note that it doesn't perform image data augmentation (which is meant to be done using preprocessing layers).

This means that I'll simply comment out the annoying print command locally for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
image Related to images PR welcome
Projects
None yet
Development

No branches or pull requests

3 participants