Skip to content
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

Preprocessing in examples #29

Open
georgedeath opened this issue Sep 20, 2021 · 1 comment
Open

Preprocessing in examples #29

georgedeath opened this issue Sep 20, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@georgedeath
Copy link

georgedeath commented Sep 20, 2021

If using the, for example, VGG19 backend, the corresponding keras guide recommends applying the preprocessing from here:

Note: each Keras Application expects a specific kind of input preprocessing. For VGG19, call tf.keras.applications.vgg19.preprocess_input on your inputs before passing them to the model. vgg19.preprocess_input will convert the input images from RGB to BGR, then will zero-center each color channel with respect to the ImageNet dataset, without scaling.

The examples show only rescaling [0, 255] to [0, 1], when, in actual fact, this is nothing like the images the backend networks were trained on. When using the correct scaling (i.e. via preprocess_input) training speed is fastly improved, at least in my experience.

@yingkaisha
Copy link
Owner

@georgedeath Thank you for pointing it out. I will experiment with this preprocessing option and update the example accordingly.

@yingkaisha yingkaisha added the documentation Improvements or additions to documentation label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants