-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
fix(export+models): Enhance support for dictionary-based model input signatures in TensorFlow and JAX #20842
base: master
Are you sure you want to change the base?
fix(export+models): Enhance support for dictionary-based model input signatures in TensorFlow and JAX #20842
Conversation
…cases) - Improves input structure validation in Model and Functional classes - Adds strict validation with clear error messages for mismatches
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20842 +/- ##
==========================================
- Coverage 82.26% 82.20% -0.06%
==========================================
Files 561 561
Lines 52693 53035 +342
Branches 8146 8228 +82
==========================================
+ Hits 43347 43600 +253
- Misses 7344 7391 +47
- Partials 2002 2044 +42
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- Make the linter happy :)
- Added shape logging for preprocessed and crossed features - Added debug messages in Functional model processing (To be removed)
TODO: Remove debugging prints. |
Ping: @mattdangerw @fchollet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Left some comments.
Thanks for the review! Will fix it at the earliest. |
Please do look into the changes and let me know if it's the intended behavior. Looking forward to your guidance, thanks! |
Ping: @fchollet, looking forward to an update on this PR. Thanks! |
Thanks for the update!
Please resolve merge conflicts. @jeffcarp does the PR look good? |
@fchollet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % some nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This fix goes beyond the requirements of the issue and adds support for handling Keras models with dictionary-based inputs, particularly when exporting to the
TFSavedModel
format for both the TensorFlow and JAX backends. Previously, models with dictionary inputs would fail during export with ValueErrors related to input structure mismatches.Key changes:
model._input_names
for dictionary-based inputs in Functional and Model classesThis PR aims to fix #20835 where models with dictionary inputs would fail to export properly to
SavedModel
format.Example of fixed functionality: