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

set strip_default_attrs=True for SavedModel exports #5439

Merged
merged 4 commits into from Oct 4, 2018

Conversation

Projects
None yet
3 participants
@robieta
Copy link
Collaborator

robieta commented Oct 4, 2018

Stripping default attributes is recommended practice for wider SavedModel portability between TensorFlow versions. (https://www.tensorflow.org/guide/saved_model#manually_build_a_savedmodel) This PR update official models to follow the convention of setting strip_default_attrs=True when exporting SavedModels.

@robieta robieta requested a review from k-w-w Oct 4, 2018

@robieta robieta requested review from karmel and tensorflow/tf-garden-team as code owners Oct 4, 2018

@googlebot googlebot added the cla: yes label Oct 4, 2018

robieta added some commits Oct 4, 2018

@k-w-w
Copy link
Member

k-w-w left a comment

Thanks for adding these changes!

@@ -565,7 +568,7 @@ def define_resnet_flags(resnet_size_choices=None):
help=flags_core.help_wrap('Skip training and only perform evaluation on '
'the latest checkpoint.'))
flags.DEFINE_boolean(
name="image_bytes_as_serving_input", default=True,
name="image_bytes_as_serving_input", default=False,

This comment has been minimized.

@k-w-w

k-w-w Oct 4, 2018

Member

Any particular reason the default is set to false?

This comment has been minimized.

@robieta

robieta Oct 4, 2018

Collaborator

Two reasons:

  1. This doesn't work properly on CIFAR, so users would have to know to go and set this to False.
  2. This is a finesse in that the input is no longer just a normal tensor, and I am generally wary of putting advanced use cases as defaults.

This comment has been minimized.

@k-w-w

k-w-w Oct 4, 2018

Member

I see, thanks for the response

@k-w-w

k-w-w approved these changes Oct 4, 2018

@robieta robieta merged commit cdcd3ec into master Oct 4, 2018

4 checks passed

Lint Python Files Internal CI build successful
Details
Ubuntu Python2 Internal CI build successful
Details
Ubuntu Python3 Internal CI build successful
Details
cla/google All necessary CLAs are signed

@robieta robieta deleted the fix/savedmodel_export_strip_attr branch Oct 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment