{"record":{"id":"ce7b11469ad6e698","repo":"keras-team/keras","slug":"unknown-fill-mode-fill-mode-expected-of-one-ce7b11","errorCode":null,"errorMessage":"Unknown `fill_mode` {fill_mode}. Expected of one {self._SUPPORTED_FILL_MODE}.","messagePattern":"Unknown `fill_mode` (.+?)\\. Expected of one (.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/preprocessing/image_preprocessing/random_zoom.py","lineNumber":130,"sourceCode":"        fill_mode=\"reflect\",\n        interpolation=\"bilinear\",\n        seed=None,\n        fill_value=0.0,\n        data_format=None,\n        **kwargs,\n    ):\n        super().__init__(**kwargs)\n        self.height_factor = height_factor\n        self.height_lower, self.height_upper = self._set_factor(\n            height_factor, \"height_factor\"\n        )\n        self.width_factor = width_factor\n        if width_factor is not None:\n            self.width_lower, self.width_upper = self._set_factor(\n                width_factor, \"width_factor\"\n            )\n        if fill_mode not in self._SUPPORTED_FILL_MODE:\n            raise NotImplementedError(\n                f\"Unknown `fill_mode` {fill_mode}. Expected of one \"\n                f\"{self._SUPPORTED_FILL_MODE}.\"\n            )\n        if interpolation not in self._SUPPORTED_INTERPOLATION:\n            raise NotImplementedError(\n                f\"Unknown `interpolation` {interpolation}. Expected of one \"\n                f\"{self._SUPPORTED_INTERPOLATION}.\"\n            )\n\n        self.fill_mode = fill_mode\n        self.fill_value = fill_value\n        self.interpolation = interpolation\n        self.seed = seed\n        self.generator = SeedGenerator(seed)\n        self.data_format = backend.standardize_data_format(data_format)\n        self.supports_jit = False\n\n    def _set_factor(self, factor, factor_name):","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/preprocessing/image_preprocessing/random_zoom.py#L112-L148","documentation":"Raised by RandomZoom's constructor when `fill_mode` is not one of \"constant\", \"reflect\", \"wrap\", \"nearest\". It controls how the newly exposed border pixels are filled after zooming out.","triggerScenarios":"Calling RandomZoom(0.2, fill_mode=\"replicate\") or any string outside the supported set.","commonSituations":"Porting augmentation configs from torchvision/OpenCV with their fill-mode names; typos in config files.","solutions":["Use one of \"constant\", \"reflect\", \"wrap\", \"nearest\"","Use \"constant\" with fill_value for a fixed color"],"exampleFix":"// before\nlayer = RandomZoom(0.2, fill_mode=\"replicate\")\n// after\nlayer = RandomZoom(0.2, fill_mode=\"reflect\")","handlingStrategy":"validation","validationCode":"assert fill_mode in {\"constant\", \"reflect\", \"wrap\", \"nearest\"}, 'unsupported fill_mode'","typeGuard":"def is_valid_fill_mode(m):\n    return m in {\"constant\", \"reflect\", \"wrap\", \"nearest\"}","tryCatchPattern":"try:\n    layer = RandomZoom(0.2, fill_mode=fill_mode)\nexcept NotImplementedError:\n    layer = RandomZoom(0.2, fill_mode=\"reflect\")","preventionTips":["Maintain a mapping table when porting torchvision/OpenCV fill modes to Keras","Add enum validation in your augmentation config loader"],"tags":["keras","preprocessing","fill-mode","augmentation"],"backgroundTag":"unsupported-enum-value","analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}