{"record":{"id":"06d6ac91d01e39fe","repo":"keras-team/keras","slug":"model-from-config-expects-a-dictionary-not-a-li","errorCode":null,"errorMessage":"`model_from_config` expects a dictionary, not a list. Received: config={config}. Did you meant to use `Sequential.from_config(config)`?","messagePattern":"`model_from_config` expects a dictionary, not a list\\. Received: config=(.+?)\\. Did you meant to use `Sequential\\.from_config\\(config\\)`\\?","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"keras/src/legacy/saving/saving_utils.py","lineNumber":39,"sourceCode":"\n\ndef model_from_config(config, custom_objects=None):\n    \"\"\"Instantiates a Keras model from its config.\n\n    Args:\n        config: Configuration dictionary.\n        custom_objects: Optional dictionary mapping names\n            (strings) to custom classes or functions to be\n            considered during deserialization.\n\n    Returns:\n        A Keras model instance (uncompiled).\n\n    Raises:\n        TypeError: if `config` is not a dictionary.\n    \"\"\"\n    if isinstance(config, list):\n        raise TypeError(\n            \"`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:","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/legacy/saving/saving_utils.py#L21-L57","documentation":"Error \"`model_from_config` expects a dictionary, not a list. Received: config={config}. Did you meant to use `Sequential.from_config(config)`?\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/legacy/saving/saving_utils.py:39 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"}