{"record":{"id":"caa3d273fd1dcefa","repo":"keras-team/keras","slug":"invalid-floatx-configuration-expected-one-of","errorCode":null,"errorMessage":"Invalid `floatx` configuration. Expected one of {'float16', 'float32', 'float64'}. Received: floatx={_floatx}","messagePattern":"Invalid `floatx` configuration\\. Expected one of (.+?)\\. Received: floatx=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/config.py","lineNumber":305,"sourceCode":"    _KERAS_DIR = os.path.join(_keras_base_dir, \".keras\")\n\n\ndef keras_home():\n    # Private accessor for the keras home location.\n    return _KERAS_DIR\n\n\n# Attempt to read Keras config file.\n_config_path = os.path.expanduser(os.path.join(_KERAS_DIR, \"keras.json\"))\nif os.path.exists(_config_path):\n    try:\n        with open(_config_path) as f:\n            _config = json.load(f)\n    except ValueError:\n        _config = {}\n    _floatx = _config.get(\"floatx\", floatx())\n    if _floatx not in {\"float16\", \"float32\", \"float64\"}:\n        raise ValueError(\n            \"Invalid `floatx` configuration. \"\n            \"Expected one of {'float16', 'float32', 'float64'}. \"\n            f\"Received: floatx={_floatx}\"\n        )\n    _epsilon = _config.get(\"epsilon\", epsilon())\n    if not isinstance(_epsilon, float):\n        raise ValueError(\n            \"Invalid `epsilon` configuration. \"\n            \"Expected a float. \"\n            f\"Received: epsilon={_epsilon}\"\n        )\n    _backend = _config.get(\"backend\", _BACKEND)\n    _image_data_format = _config.get(\"image_data_format\", image_data_format())\n    if _image_data_format not in {\"channels_last\", \"channels_first\"}:\n        raise ValueError(\n            \"Invalid `image_data_format` configuration. \"\n            \"Expected one of {'channels_last', 'channels_first'}. \"\n            f\"Received: image_data_format={_image_data_format}\"","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/config.py#L287-L323","documentation":"Error \"Invalid `floatx` configuration. Expected one of {'float16', 'float32', 'float64'}. Received: floatx={_floatx}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/config.py:305 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}