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

Remove unnecessary model parsing from keras.model.load_model #47435

Merged

Conversation

lgeiger
Copy link
Contributor

@lgeiger lgeiger commented Feb 26, 2021

This PR removes duplicated SavedModel parsing from keras.model.load_model. The result of parsing was never used and it is also not needed for error handling either since the same function will be called at the start of saved_model_load.load:

meta_graph_def = loader_impl.parse_saved_model(path).meta_graphs[0]

This removes the need to read the file content and parse the saved model twice which can improve performance when loading models from a remote file system like GCS.

@google-ml-butler google-ml-butler bot added the size:XS CL Change Size: Extra Small label Feb 26, 2021
@google-cla google-cla bot added the cla: yes label Feb 26, 2021
@gbaned gbaned self-assigned this Feb 26, 2021
@gbaned gbaned added the comp:keras Keras related issues label Feb 26, 2021
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Feb 26, 2021
@gbaned gbaned self-requested a review February 26, 2021 18:45
@gbaned gbaned added the awaiting review Pull request awaiting review label Mar 1, 2021
@monicadsong monicadsong self-requested a review March 11, 2021 23:01
Copy link
Member

@monicadsong monicadsong left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Mar 11, 2021
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Mar 11, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Mar 11, 2021
@gbaned gbaned removed the awaiting review Pull request awaiting review label Mar 12, 2021
@rthadur rthadur added ready to pull PR ready for merge process and removed ready to pull PR ready for merge process labels Mar 12, 2021
@copybara-service copybara-service bot merged commit 5b505a3 into tensorflow:master Mar 13, 2021
PR Queue automation moved this from Approved by Reviewer to Merged Mar 13, 2021
@lgeiger lgeiger deleted the speedup-keras-saved-model-loading branch March 13, 2021 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:keras Keras related issues ready to pull PR ready for merge process size:XS CL Change Size: Extra Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

5 participants