{"record":{"id":"b51d99e155937e8f","repo":"keras-team/keras","slug":"unknown-interpolation-interpolation-expected-b51d99","errorCode":null,"errorMessage":"Unknown `interpolation` {interpolation}. Expected of one {self._SUPPORTED_INTERPOLATION}.","messagePattern":"Unknown `interpolation` (.+?)\\. Expected of one (.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/preprocessing/image_preprocessing/random_zoom.py","lineNumber":135,"sourceCode":"        **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):\n        if isinstance(factor, (tuple, list)):\n            if len(factor) != 2:\n                raise ValueError(\n                    self._FACTOR_VALIDATION_ERROR\n                    + f\"Received: {factor_name}={factor}\"","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/preprocessing/image_preprocessing/random_zoom.py#L117-L153","documentation":"Raised by RandomZoom's constructor when `interpolation` is not \"nearest\" or \"bilinear\". These are the only resampling methods implemented for the zoom transform.","triggerScenarios":"Calling RandomZoom(0.2, interpolation=\"bicubic\") or \"area\".","commonSituations":"Copying interpolation settings from tf.image.resize or another layer/version that supports more methods; assuming OpenCV-style flags work.","solutions":["Use \"bilinear\" (default, smooth) or \"nearest\" (fast)","Pre/post-resize with tf.image.resize if you need higher-order interpolation"],"exampleFix":"// before\nlayer = RandomZoom(0.2, interpolation=\"area\")\n// after\nlayer = RandomZoom(0.2, interpolation=\"bilinear\")","handlingStrategy":"validation","validationCode":"assert interpolation in {\"nearest\", \"bilinear\"}, 'RandomZoom supports only nearest/bilinear'","typeGuard":"def is_valid_interp(v):\n    return v in {\"nearest\", \"bilinear\"}","tryCatchPattern":"try:\n    layer = RandomZoom(0.2, interpolation=interp)\nexcept NotImplementedError:\n    layer = RandomZoom(0.2, interpolation=\"bilinear\")","preventionTips":["Restrict config schemas to the two supported values","Do extra resampling outside the layer if higher-order interpolation is needed"],"tags":["keras","preprocessing","interpolation","augmentation"],"backgroundTag":"unsupported-enum-value","analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}