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

Added fit_generator hooks for autolog #1757

Merged
merged 3 commits into from Sep 3, 2019

Conversation

charnger
Copy link
Contributor

What changes are proposed in this pull request?

When using keras fit_generator instead it fit, the callback hooks are currently not installed. This patch fixes it.

How is this patch tested?

Only by running it on my data. I wasn't able to run the test_keras_autolog.py without errors on master with reasonable effort yet.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Keras autolog hooks now work when using model.fit_generator, not just model.fit.

(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)

What component(s) does this PR affect?

  • UI
  • CLI
  • API
  • REST-API
  • Examples
  • Docs
  • Tracking
  • Projects
  • Artifacts
  • Models
  • Scoring
  • Serving
  • R
  • Java
  • Python

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

@mateiz
Copy link
Contributor

mateiz commented Aug 20, 2019

Thanks for the patch! Looks like this is causing some existing tests to fail though. Can you fix those, and also add tests that directly cover fit_generator?

@charnger
Copy link
Contributor Author

I fixed the failing tests. In my virtual env, some small and some large tests are still failing, but the same ones as in master.
I also added a simple variant for the fit_generator into test_keras_autolog.py

@pogil pogil requested a review from smurching August 22, 2019 16:07

return client.get_run(run.info.run_id)


@pytest.mark.large
@pytest.mark.parametrize('fit_variant', ['fit', 'fit_generator'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, could we also add this parametrization to test_keras_autolog_model_can_load_from_artifact so that we have test coverage verifying that autologging logs a model when fit_generator is used?

Copy link
Collaborator

@smurching smurching left a comment

Choose a reason for hiding this comment

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

One comment on test coverage, otherwise LGTM!

@charnger
Copy link
Contributor Author

charnger commented Sep 2, 2019

Done

Copy link
Collaborator

@smurching smurching left a comment

Choose a reason for hiding this comment

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

LGTM thanks @charnger!

@smurching smurching added the rn/feature Mention under Features in Changelogs. label Sep 3, 2019
@smurching smurching merged commit 34b28c8 into mlflow:master Sep 3, 2019
ustcscgyer pushed a commit to ustcscgyer/mlflow that referenced this pull request Sep 5, 2019
Keras autolog hooks now work when using model.fit_generator, not just model.fit.
@mobiuscreek mobiuscreek mentioned this pull request Oct 2, 2019
22 tasks
avflor pushed a commit to avflor/mlflow that referenced this pull request Aug 22, 2020
Keras autolog hooks now work when using model.fit_generator, not just model.fit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn/feature Mention under Features in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants