keras-team/keras · error · NotImplementedError
Model {self.__class__.__name__} does not have a `call()` met
Error message
Model {self.__class__.__name__} does not have a `call()` method implemented. What it means
Error "Model {self.__class__.__name__} does not have a `call()` method implemented." thrown in keras-team/keras.
Source
Thrown at keras/src/models/model.py:169
from keras.src.models.functional import Functional
return Functional.__new__(Functional, *args, **kwargs)
return typing.cast(cls, super().__new__(cls))
def __init__(self, *args, **kwargs):
Trainer.__init__(self)
from keras.src.models import functional
# Signature detection for usage of a `Model` subclass
# as a `Functional` subclass
if functional_init_arguments(args, kwargs):
inject_functional_model_class(self.__class__)
functional.Functional.__init__(self, *args, **kwargs)
else:
Layer.__init__(self, *args, **kwargs)
def call(self, *args, **kwargs):
raise NotImplementedError(
f"Model {self.__class__.__name__} does not have a `call()` "
"method implemented."
)
@property
def layers(self):
return list(self._flatten_layers(include_self=False, recursive=False))
@layers.setter
def layers(self, _):
raise AttributeError(
"`Model.layers` attribute is reserved and should not be used. "
"Please use another name."
)
@traceback_utils.filter_traceback
def get_layer(self, name=None, index=None):
"""Retrieves a layer based on either its name (unique) or index.View on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/models/model.py:169 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25).
Data as JSON: /api/errors/c745d2d7c235fa51.
Report an issue: GitHub.