hub
hub copied to clipboard
Fix KerasLayer compatibility with Keras 3.x/TF 2.16+
Fixes #101201
- Replaced deprecated
_add_existing_weightimplementation that previously relied on unsupported arguments (experimental_autocast,getter) removed in Keras 3.x. - Introduced custom weight lists (
_hub_trainable_weights,_hub_non_trainable_weights) instead of using the deprecated_track_variableapproach. - Overrode
trainable_weightsandnon_trainable_weightsproperties to properly expose hub weights to the Keras layer system. - Resolves the
ValueError: Only instances of keras.Layer can be added to a Sequential modeland related integration failures when usinghub.KerasLayerin Sequential/Functional models.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.