You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
10 frames
TypeError: Could not locate class 'CustomLayer'. Make sure custom classes are decorated with @keras.saving.register_keras_serializable(). Full object config: {'module': None, 'class_name': 'CustomLayer', 'config': {'factor': 0.5}, 'registered_name': 'MyLayers>CustomLayer', 'build_config': {'input_shape': [None, 4]}, 'name': 'custom_layer', 'inbound_nodes': [{'args': [{'class_name': 'keras_tensor', 'config': {'shape': [None, 4], 'dtype': 'float32', 'keras_history': ['input_layer', 0, 0]}}], 'kwargs': {}}]}
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/keras/src/saving/serialization_lib.py in deserialize_keras_object(config, custom_objects, safe_mode, **kwargs)
718 instance = cls.from_config(inner_config)
719 except TypeError as e:
--> 720 raise TypeError(
721 f"{cls} could not be deserialized properly. Please"
722 " ensure that components that are Python object"
TypeError: <class 'keras.src.models.functional.Functional'> could not be deserialized properly. Please ensure that components that are Python object instances (layers, models, etc.) returned by get_config() are explicitly deserialized in the model's from_config() method.
You'll need to upgrade your code to support Keras 3 in the medium term (see #4744) In the short term you can use the fallback version as described there.
You'll need to upgrade your code to support Keras 3 in the medium term (see #4744) In the short term you can use the fallback version as described there.
Well, this code example is from karas 3 official document.
Describe the current behavior
This is an example from official keras document:
Error:
Describe the expected behavior
Should load the model successfully
What web browser you are using
Chrome
The text was updated successfully, but these errors were encountered: