keras-team/keras · error · ValueError

All `outputs` values must be KerasTensors. Received: outputs

Error message

All `outputs` values must be KerasTensors. Received: outputs={outputs} including invalid value {x} of type {type(x)}

What it means

Error "All `outputs` values must be KerasTensors. Received: outputs={outputs} including invalid value {x} of type {type(x)}" thrown in keras-team/keras.

Source

Thrown at keras/src/models/functional.py:126

                        "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)

        if trainable is not None:
            self.trainable = trainable

        for layer in self.layers:
            self._tracker.track(layer)
        self.build(None)
        # We will convert directly (to the correct dtype per input).

View on GitHub (pinned to 7a34a03db6)

When it happens

Trigger: Thrown at keras/src/models/functional.py:126 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/a1a45abf08273bd7. Report an issue: GitHub.