keras-team/keras · error · ValueError
All `inputs` values must be KerasTensors. Received: inputs={
Error message
All `inputs` values must be KerasTensors. Received: inputs={inputs} including invalid value {x} of type {type(x)} What it means
Error "All `inputs` values must be KerasTensors. Received: inputs={inputs} including invalid value {x} of type {type(x)}" thrown in keras-team/keras.
Source
Thrown at keras/src/models/functional.py:119
def __init__(self, inputs, outputs, name=None, **kwargs):
if isinstance(inputs, dict):
for k, v in inputs.items():
if isinstance(v, backend.KerasTensor) and k != v.name:
warnings.warn(
"When providing `inputs` as a dict, all keys in the "
"dict must match the names of the corresponding "
f"tensors. Received key '{k}' mapping to value {v} "
f"which has name '{v.name}'. Change the tensor name to "
f"'{k}' (via `Input(..., name='{k}')`)"
)
trainable = kwargs.pop("trainable", None)
flat_inputs = tree.flatten(inputs)
flat_outputs = tree.flatten(outputs)
for x in flat_inputs:
if not isinstance(x, backend.KerasTensor):
raise ValueError(
"All `inputs` values must be KerasTensors. Received: "
f"inputs={inputs} including invalid value {x} of "
f"type {type(x)}"
)
for x in flat_outputs:
if not isinstance(x, backend.KerasTensor):
raise ValueError(
"All `outputs` values must be KerasTensors. Received: "
f"outputs={outputs} including invalid value {x} of "
f"type {type(x)}"
)
if not all(is_input_keras_tensor(t) for t in flat_inputs):
inputs, outputs = clone_graph_nodes(inputs, outputs)
with tracking.DotNotTrackScope():
Function.__init__(self, inputs, outputs, name=name)
View on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/models/functional.py:119 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/68a26624f26f2c38.
Report an issue: GitHub.