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

Allow generators into Model's fit, evaluate and predict #12568

Merged

Conversation

lucasdavid
Copy link
Contributor

Summary

I've ported the interesting sections of the code implemented in tensorflow/keras/engine/training.py#L749
and some necessary utils. Generators and Sequences can now be passed to Model#fit, Model#evaluate and Model#predict.

The parameters max_queue_size, workers, use_multiprocessing were added to these methods (they now have the exact same signature as the ones in tf.keras.

Related Issues

#11772

PR Overview

  • [y] This PR requires new unit tests [y/n] (make sure tests are included)
  • [n] This PR requires to update the documentation [y/n] (make sure the docs are up-to-date)
  • [y] This PR is backwards compatible [y/n]
  • [n] This PR changes the current API [y/n] (all API changes need to be approved by fchollet)

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. When you copy code from tf.keras, please make sure to adapt it: for instance, tf.data references are not relevant, docstring formatting is different, etc.

keras/engine/training.py Outdated Show resolved Hide resolved
keras/engine/training.py Outdated Show resolved Hide resolved
keras/engine/training.py Outdated Show resolved Hide resolved
keras/engine/training.py Outdated Show resolved Hide resolved
keras/engine/training.py Outdated Show resolved Hide resolved
keras/engine/training_utils.py Outdated Show resolved Hide resolved
@lucasdavid lucasdavid force-pushed the sync-fit-predict-evaluate-tf branch 2 times, most recently from c82e2d4 to 22e0529 Compare April 3, 2019 03:17
@lucasdavid
Copy link
Contributor Author

@fchollet everything's fixed now.

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you!

@fchollet fchollet merged commit 7c7e51e into keras-team:master Apr 3, 2019
@lucasdavid lucasdavid deleted the sync-fit-predict-evaluate-tf branch April 4, 2019 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants