{"record":{"id":"d1031a102c758776","repo":"keras-team/keras","slug":"invalid-value-for-argument-aggregation-expected","errorCode":null,"errorMessage":"Invalid value for argument `aggregation`. Expected one of `None`, `'none'`, `'mean'`, `'sum'`, `'only_first_replica'`. Received: aggregation={aggregation}","messagePattern":"Invalid value for argument `aggregation`\\. Expected one of `None`, `'none'`, `'mean'`, `'sum'`, `'only_first_replica'`\\. Received: aggregation=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/variables.py","lineNumber":121,"sourceCode":"        name=None,\n        layout=None,\n        **kwargs,\n    ):\n        name = name or auto_name(self.__class__.__name__)\n        if not isinstance(name, str) or \"/\" in name:\n            raise ValueError(\n                \"Argument `name` must be a string and \"\n                \"cannot contain character `/`. \"\n                f\"Received: name={name}\"\n            )\n        if aggregation not in (\n            None,\n            \"none\",\n            \"mean\",\n            \"sum\",\n            \"only_first_replica\",\n        ):\n            raise ValueError(\n                \"Invalid value for argument `aggregation`. Expected \"\n                \"one of `None`, `'none'`, `'mean'`, `'sum'`, \"\n                \"`'only_first_replica'`. \"\n                f\"Received: aggregation={aggregation}\"\n            )\n        if aggregation is None:\n            aggregation = \"none\"\n        if synchronization not in (\n            None,\n            \"none\",\n            \"on_read\",\n            \"on_write\",\n            \"auto\",\n        ):\n            raise ValueError(\n                \"Invalid value for argument `synchronization`. Expected \"\n                \"one of `None`, `'none'`, `'on_read'`, `'on_write'`, \"\n                \"`'auto'`. \"","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/variables.py#L103-L139","documentation":"Error \"Invalid value for argument `aggregation`. Expected one of `None`, `'none'`, `'mean'`, `'sum'`, `'only_first_replica'`. Received: aggregation={aggregation}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/variables.py:121 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"}