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 #1369

Open
bpaul4 opened this issue Mar 11, 2024 · 6 comments · May be fixed by #1401
Open

Resolve Keras File Format Issues #1369

bpaul4 opened this issue Mar 11, 2024 · 6 comments · May be fixed by #1401
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. Python 3.9+ tests that install the latest package now throw 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.

@bpaul4 bpaul4 added the Priority:High High Priority Issue or PR label Mar 11, 2024
@bpaul4 bpaul4 assigned bpaul4 and rundxdi and unassigned bpaul4 Mar 11, 2024
@bpaul4
Copy link
Contributor Author

bpaul4 commented Mar 11, 2024

@rundxdi I briefly investigated the issue and it will require updating the KerasSurrogate "save_to_folder" and "load_from_folder" methods with serialization to a ".keras" format instead, and related front-end changes in tests that use the methods. Please work on this when you can, as it is a breaking issue in IDAES at the moment. Thank you.

@rundxdi
Copy link
Contributor

rundxdi commented Mar 12, 2024

@rundxdi I briefly investigated the issue and it will require updating the KerasSurrogate "save_to_folder" and "load_from_folder" methods with serialization to a ".keras" format instead, and related front-end changes in tests that use the methods. Please work on this when you can, as it is a breaking issue in IDAES at the moment. Thank you.

Thanks for identifying the needed updates. I'll take a look tomorrow and work on updates this week.

@ksbeattie
Copy link
Member

@rundxdi any estimate on this?

@ksbeattie
Copy link
Member

@rundxdi any news on this? Maybe join the next dev call to update us?

@rundxdi
Copy link
Contributor

rundxdi commented Apr 18, 2024

@rundxdi any news on this? Maybe join the next dev call to update us?

@ksbeattie I should finally have an update at or before the next dev call, sorry for the delay!

@rundxdi rundxdi linked a pull request Apr 25, 2024 that will close this issue
@rundxdi
Copy link
Contributor

rundxdi commented Apr 25, 2024

@ksbeattie I've opened PR #1401 to address this. It should fix keras_surrogate.py and test_keras_surrogate.py. However, I'm having trouble getting test_keras_plotting.py to work with the changes and its existing model. Working on that currently.

@ksbeattie ksbeattie linked a pull request May 23, 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.

3 participants