keras-team/keras · error · ValueError

Invalid `epsilon` configuration. Expected a float. Received:

Error message

Invalid `epsilon` configuration. Expected a float. Received: epsilon={_epsilon}

What it means

Error "Invalid `epsilon` configuration. Expected a float. Received: epsilon={_epsilon}" thrown in keras-team/keras.

Source

Thrown at keras/src/backend/config.py:312

# Attempt to read Keras config file.
_config_path = os.path.expanduser(os.path.join(_KERAS_DIR, "keras.json"))
if os.path.exists(_config_path):
    try:
        with open(_config_path) as f:
            _config = json.load(f)
    except ValueError:
        _config = {}
    _floatx = _config.get("floatx", floatx())
    if _floatx not in {"float16", "float32", "float64"}:
        raise ValueError(
            "Invalid `floatx` configuration. "
            "Expected one of {'float16', 'float32', 'float64'}. "
            f"Received: floatx={_floatx}"
        )
    _epsilon = _config.get("epsilon", epsilon())
    if not isinstance(_epsilon, float):
        raise ValueError(
            "Invalid `epsilon` configuration. "
            "Expected a float. "
            f"Received: epsilon={_epsilon}"
        )
    _backend = _config.get("backend", _BACKEND)
    _image_data_format = _config.get("image_data_format", image_data_format())
    if _image_data_format not in {"channels_last", "channels_first"}:
        raise ValueError(
            "Invalid `image_data_format` configuration. "
            "Expected one of {'channels_last', 'channels_first'}. "
            f"Received: image_data_format={_image_data_format}"
        )
    _nnx_enabled_config = _config.get("nnx_enabled", _NNX_ENABLED)

    # Apply basic configs that don't cause circular import
    set_floatx(_floatx)
    _NNX_ENABLED = _nnx_enabled_config
    set_epsilon(_epsilon)

View on GitHub (pinned to 7a34a03db6)

When it happens

Trigger: Thrown at keras/src/backend/config.py:312 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/15a72326ecd381ed. Report an issue: GitHub.