Skip to content

Commit

Permalink
Fix serialization of domain packages.
Browse files Browse the repository at this point in the history
Not all of their symbols are exported.
  • Loading branch information
hertschuh committed Jan 13, 2025
1 parent e010829 commit e72c16b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keras/src/saving/serialization_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,8 @@ def _retrieve_class_or_fn(

# Otherwise, attempt to retrieve the class object given the `module`
# and `class_name`. Import the module, find the class.
if module == "keras.src" or module.startswith("keras.src."):
package = module.split(".", maxsplit=1)[0]
if package in {"keras", "keras_hub", "keras_cv", "keras_nlp"}:
try:
mod = importlib.import_module(module)
obj = vars(mod).get(name, None)
Expand Down

0 comments on commit e72c16b

Please sign in to comment.