keras-team/keras · error · ValueError

Saved configuration not understood. Configuration should be

Error message

Saved configuration not understood. Configuration should be a dictionary, string, tuple or list. Received: config={config}.

What it means

Error "Saved configuration not understood. Configuration should be a dictionary, string, tuple or list. Received: config={config}." thrown in keras-team/keras.

Source

Thrown at keras/src/legacy/saving/saving_utils.py:219

        if isinstance(obj, str):
            return True  # Serialized function or string.
        return False

    if config is None:
        return None
    if _is_single_object(config):
        return deserialize_fn(config)
    elif isinstance(config, dict):
        return {
            k: _deserialize_nested_config(deserialize_fn, v)
            for k, v in config.items()
        }
    elif isinstance(config, (tuple, list)):
        return [
            _deserialize_nested_config(deserialize_fn, obj) for obj in config
        ]

    raise ValueError(
        "Saved configuration not understood. Configuration should be a "
        f"dictionary, string, tuple or list. Received: config={config}."
    )


def _deserialize_metric(metric_config):
    """Deserialize metrics, leaving special strings untouched."""
    if metric_config in ["accuracy", "acc", "crossentropy", "ce"]:
        # Do not deserialize accuracy and cross-entropy strings as we have
        # special case handling for these in compile, based on model output
        # shape.
        return metric_config
    return metrics_module.deserialize(metric_config)


def _resolve_compile_arguments_compat(obj, obj_config, module):
    """Resolves backwards compatibility issues with training config arguments.

View on GitHub (pinned to 7a34a03db6)

When it happens

Trigger: Thrown at keras/src/legacy/saving/saving_utils.py:219 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/65b9f3550e8d44a8. Report an issue: GitHub.