{"record":{"id":"57b8fb1f85a7a67f","repo":"keras-team/keras","slug":"the-provided-configuration-is-not-a-valid-keras-co","errorCode":null,"errorMessage":"The provided configuration is not a valid Keras configuration. Expected a dictionary containing a 'config' key. Received: config={config}","messagePattern":"The provided configuration is not a valid Keras configuration\\. Expected a dictionary containing a 'config' key\\. Received: config=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/legacy/saving/saving_utils.py","lineNumber":58,"sourceCode":"            \"`model_from_config` expects a dictionary, not a list. \"\n            f\"Received: config={config}. Did you meant to use \"\n            \"`Sequential.from_config(config)`?\"\n        )\n\n    global MODULE_OBJECTS\n\n    if not hasattr(MODULE_OBJECTS, \"ALL_OBJECTS\"):\n        from keras.src import layers\n        from keras.src import models\n\n        MODULE_OBJECTS.ALL_OBJECTS = layers.__dict__\n        MODULE_OBJECTS.ALL_OBJECTS[\"InputLayer\"] = layers.InputLayer\n        MODULE_OBJECTS.ALL_OBJECTS[\"Functional\"] = models.Functional\n        MODULE_OBJECTS.ALL_OBJECTS[\"Model\"] = models.Model\n        MODULE_OBJECTS.ALL_OBJECTS[\"Sequential\"] = models.Sequential\n\n    if not isinstance(config, dict) or \"config\" not in config:\n        raise ValueError(\n            \"The provided configuration is not a valid Keras configuration. \"\n            \"Expected a dictionary containing a 'config' key. \"\n            f\"Received: config={config}\"\n        )\n    batch_input_shape = config[\"config\"].pop(\"batch_input_shape\", None)\n    if batch_input_shape is not None:\n        if config[\"class_name\"] == \"InputLayer\":\n            config[\"config\"][\"batch_shape\"] = batch_input_shape\n        else:\n            config[\"config\"][\"input_shape\"] = batch_input_shape\n\n    axis = config[\"config\"].pop(\"axis\", None)\n    if axis is not None:\n        if isinstance(axis, list) and len(axis) == 1:\n            config[\"config\"][\"axis\"] = int(axis[0])\n        elif isinstance(axis, (int, float)):\n            config[\"config\"][\"axis\"] = int(axis)\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/legacy/saving/saving_utils.py#L40-L76","documentation":"Error \"The provided configuration is not a valid Keras configuration. Expected a dictionary containing a 'config' key. Received: config={config}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/legacy/saving/saving_utils.py:58 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"}