{"record":{"id":"f4bf442f39cc87be","repo":"keras-team/keras","slug":"number-of-groups-self-groups-must-be-a-multipl","errorCode":null,"errorMessage":"Number of groups ({self.groups}) must be a multiple of the number of channels ({dim}).","messagePattern":"Number of groups \\((.+?)\\) must be a multiple of the number of channels \\((.+?)\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/normalization/group_normalization.py","lineNumber":123,"sourceCode":"\n        if dim is None:\n            raise ValueError(\n                f\"Axis {self.axis} of input tensor should have a defined \"\n                \"dimension but the layer received an input with shape \"\n                f\"{input_shape}.\"\n            )\n\n        if self.groups == -1:\n            self.groups = dim\n\n        if dim < self.groups:\n            raise ValueError(\n                f\"Number of groups ({self.groups}) cannot be more than the \"\n                f\"number of channels ({dim}).\"\n            )\n\n        if dim % self.groups != 0:\n            raise ValueError(\n                f\"Number of groups ({self.groups}) must be a multiple \"\n                f\"of the number of channels ({dim}).\"\n            )\n\n        self.input_spec = InputSpec(\n            ndim=len(input_shape), axes={self.axis: dim}\n        )\n\n        if self.scale:\n            self.gamma = self.add_weight(\n                shape=(dim,),\n                name=\"gamma\",\n                initializer=self.gamma_initializer,\n                regularizer=self.gamma_regularizer,\n                constraint=self.gamma_constraint,\n                autocast=False,\n            )\n        else:","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/normalization/group_normalization.py#L105-L141","documentation":"Error \"Number of groups ({self.groups}) must be a multiple of the number of channels ({dim}).\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/normalization/group_normalization.py:123 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"}