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

Resolve Keras File Format Issues #1202

Open
bpaul4 opened this issue Mar 11, 2024 · 1 comment · May be fixed by #1223
Open

Resolve Keras File Format Issues #1202

bpaul4 opened this issue Mar 11, 2024 · 1 comment · May be fixed by #1223
Assignees
Labels
Priority:High High Priority Issue or PR

Comments

@bpaul4
Copy link
Contributor

bpaul4 commented Mar 11, 2024

TensorFlow updated to version 2.16.1 on March 8, 2024. Calling Keras in Python 3.9+ environments now throws errors similar to the message below:

E           ValueError: File format not supported: filepath=D:\a\idaes-pse\idaes-pse\idaes\core\surrogate\plotting\tests\keras_surrogate. Keras 3 only supports V3 `.keras` files and legacy H5 format files (`.h5` extension). Note that the legacy SavedModel format is not supported by `load_model()` in Keras 3. In order to reload a TensorFlow SavedModel as an inference-only layer in Keras 3, use `keras.layers.TFSMLayer(D:\a\idaes-pse\idaes-pse\idaes\core\surrogate\plotting\tests\keras_surrogate, call_endpoint='serving_default')` (note that your `call_endpoint` might have a different name).

Tests and code that use Keras should be updated accordingly. This is not currently a breaking issue because we only run Keras in Python 3.8 test environments which use an older Keras version. It would be good to discuss whether running optional dependencies in 3.9 or 3.10 instead of 3.8 going forwards is worthwhile.

@bpaul4 bpaul4 added the Priority:Low Low Priority Issue or PR label Mar 11, 2024
@bpaul4 bpaul4 self-assigned this Mar 11, 2024
@ksbeattie
Copy link
Member

Will follow how this is addressed in IDAES: IDAES/idaes-pse#1369

@ksbeattie ksbeattie added Priority:High High Priority Issue or PR and removed Priority:Low Low Priority Issue or PR labels Mar 12, 2024
@bpaul4 bpaul4 linked a pull request May 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:High High Priority Issue or PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants