{"record":{"id":"f33b02ac85318813","repo":"keras-team/keras","slug":"both-num-bins-and-bin-boundaries-should-not-be","errorCode":null,"errorMessage":"Both `num_bins` and `bin_boundaries` should not be set. Received: `num_bins={num_bins}` and `bin_boundaries={bin_boundaries}`","messagePattern":"Both `num_bins` and `bin_boundaries` should not be set\\. Received: `num_bins=(.+?)` and `bin_boundaries=(.+?)`","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/preprocessing/discretization.py","lineNumber":131,"sourceCode":"        argument_validation.validate_string_arg(\n            output_mode,\n            allowable_strings=(\n                \"int\",\n                \"one_hot\",\n                \"multi_hot\",\n                \"count\",\n            ),\n            caller_name=self.__class__.__name__,\n            arg_name=\"output_mode\",\n        )\n\n        if num_bins is not None and num_bins < 0:\n            raise ValueError(\n                \"`num_bins` must be greater than or equal to 0. \"\n                f\"Received: `num_bins={num_bins}`\"\n            )\n        if num_bins is not None and bin_boundaries is not None:\n            raise ValueError(\n                \"Both `num_bins` and `bin_boundaries` should not be set. \"\n                f\"Received: `num_bins={num_bins}` and \"\n                f\"`bin_boundaries={bin_boundaries}`\"\n            )\n        if num_bins is None and bin_boundaries is None:\n            raise ValueError(\n                \"You need to set either `num_bins` or `bin_boundaries`.\"\n            )\n\n        self.bin_boundaries = bin_boundaries\n        self.num_bins = num_bins\n        self.epsilon = epsilon\n        self.output_mode = output_mode\n        self.sparse = sparse\n\n        if self.bin_boundaries:\n            self.summary = None\n        else:","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/preprocessing/discretization.py#L113-L149","documentation":"Error \"Both `num_bins` and `bin_boundaries` should not be set. Received: `num_bins={num_bins}` and `bin_boundaries={bin_boundaries}`\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/preprocessing/discretization.py:131 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"}