-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
Keras 3 / TF SavedModel export issues #19458
Comments
We don't recommend using The recommended way is
The input dtype and the input name are preserved. The output tensor name is not the name of the output layer, however. If you want to maintain that you will have to insert a If you need more granular control over the endpoints and their signatures, you should use If you want the behavior of |
Thanks! That helps a lot.
Here's what led me down that path: keras/keras/saving/saving_api.py Lines 110 to 111 in 5dd801a
|
Good catch, we should update that comment. That path does work most of the time but it isn't nearly as reliable as the one we actually control ( |
It seems like TF SavedModel is not accurately exporting a Keras 3.x model. At least, dtype is incorrect in some cases and layer names are not exported.
Minimal example:
Comparing
saved_model_cli
output of a TF SavedModel from this example withTF_USE_LEGACY_KERAS=1
(andtf_keras
installed) against that of a TF SavedModel whenTF_USE_ LEGACY_KERAS=0
results in the following diff:The text was updated successfully, but these errors were encountered: