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

Preparation for switch in Keras serialization format #1851

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

nkovela1
Copy link
Contributor

@nkovela1 nkovela1 commented Feb 9, 2023

This PR changes serialization API calls in AutoKeras to the legacy APIs in preparation for a switch to the new Keras object serialization format. There is no change in functionality now by this switch to the legacy APIs.

@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (db59676) compared to base (49f93db).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1851   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        50           
  Lines         2920      2929    +9     
=========================================
+ Hits          2920      2929    +9     
Impacted Files Coverage Δ
autokeras/blocks/__init__.py 100.00% <100.00%> (ø)
autokeras/hyper_preprocessors.py 100.00% <100.00%> (ø)
autokeras/nodes.py 100.00% <100.00%> (ø)
autokeras/preprocessors/__init__.py 100.00% <100.00%> (ø)
autokeras/utils/utils.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@haifeng-jin haifeng-jin 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! Please make the changes and the CI will pass.


def serialize_keras_object(obj):
if hasattr(tf.keras.utils, "legacy"):
return tf.keras.utils.legacy.serialize_keras_object(obj)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please append # pragma: no cover to this line to mark it as not covered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

config, module_objects=None, custom_objects=None, printable_module_name=None
):
if hasattr(tf.keras.utils, "legacy"):
return tf.keras.utils.legacy.deserialize_keras_object(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please append # pragma: no cover to this line to mark it as not covered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@haifeng-jin haifeng-jin merged commit 94f3750 into keras-team:master Feb 9, 2023
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.

2 participants