Skip to content

Conversation

athulya-anil
Copy link

Fixes #101201

  • Replaced deprecated _add_existing_weight implementation 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_variable approach.
  • Overrode trainable_weights and non_trainable_weights properties to properly expose hub weights
    to the Keras layer system.
  • Resolves the ValueError: Only instances of keras.Layer can be added to a Sequential model
    and related integration failures when using hub.KerasLayer in Sequential/Functional models.

Copy link

google-cla bot commented Sep 27, 2025

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.

@athulya-anil athulya-anil force-pushed the fix-keras3-compatibility-101201 branch from b4c013c to 23b2e7b Compare September 27, 2025 18:20
- Replaced deprecated _add_existing_weight implementation 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_variable approach.
Overrode trainable_weights and non_trainable_weights properties to properly expose hub weights to the Keras layer system.
- Resolves the ValueError: Only instances of keras.Layer can be added to a Sequential model and related integration failures when using hub.KerasLayer in Sequential/Functional models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant