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

add support for tensorflow 2.16 / py312 to spacekit #8468

Closed
stscijgbot-jp opened this issue May 7, 2024 · 2 comments
Closed

add support for tensorflow 2.16 / py312 to spacekit #8468

stscijgbot-jp opened this issue May 7, 2024 · 2 comments

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3615 was created on JIRA by Ru Kein:

The minimum version of tensorflow available in Python 3.12 is tensorflow~=2.16, which is not available below python 3.12. The version of Keras ported in tf>=2.16 (keras 3) contains backwards incompatible API changes, including methods for saving and loading models. In order to maintain compatibility across versions of python, at least as far as loading pre-built neural networks is concerned, a possible solution is to simply save 2 versions of each model: one that can be loaded in tf<=2.15 (python 3.10, 3.11), and a newer one that can be loaded using tf>=2.16. 

The main drawback to this is an increase in the size of the package installation, since the pre-built networks are included as part of the package data, specifically for use in pipeline applications. In the future, once the pipelines are using python 3.12 or higher, the older versions of the models can be removed.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Ru Kein on JIRA:

Made the executive decision to bump up minimum version of tensorflow to 2.16.1, re-saved all models using Keras 3 / tf 2.16.1. Was able to load these in python 3.10, 3.11, 3.12 so no api changes required. Minor revisions to internal methods that have been dropped such as "model.name_scope()".

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Ru Kein on JIRA:

Tests are passing on Python 3.10, 3.11, 3.12 using tensorflow 2.16.1. An additional revision was needed relating to the batch generator for stacked ensemble model inputs. Tensorflow didn't like the list format of the stacked inputs. Changing this to a tuple fixed it.

spacetelescope/spacekit#73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant