{"record":{"id":"ef14de0d746fc9ac","repo":"tensorflow/models","slug":"the-key-r-does-not-exist-in-r-to-extend-the","errorCode":null,"errorMessage":"The key {!r} does not exist in {!r}. To extend the existing keys, use `override` with `is_strict` = False.","messagePattern":"The key (.+?) does not exist in (.+?)\\. To extend the existing keys, use `override` with `is_strict` = False\\.","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"official/modeling/hyperparams/base_config.py","lineNumber":299,"sourceCode":"  def _override(self, override_dict, is_strict=True):\n    \"\"\"Overrides same method in ParamsDict.\n\n    Also called by ParamsDict methods.\n\n    Args:\n      override_dict: dictionary to write to .\n      is_strict: If True, not allows to add new keys.\n\n    Raises:\n      KeyError: overriding reserved keys or keys not exist (is_strict=True).\n    \"\"\"\n    for k, v in sorted(override_dict.items()):\n      if k in self.RESERVED_ATTR:\n        raise KeyError('The key {!r} is internally reserved. '\n                       'Can not be overridden.'.format(k))\n      if k not in self.__dict__:\n        if is_strict:\n          raise KeyError('The key {!r} does not exist in {!r}. '\n                         'To extend the existing keys, use '\n                         '`override` with `is_strict` = False.'.format(\n                             k, type(self)))\n        else:\n          self._set(k, v)\n      else:\n        if isinstance(v, dict) and hasattr(self.__dict__[k], '_override'):\n          self.__dict__[k]._override(v, is_strict)  # pylint: disable=protected-access\n        elif isinstance(v, params_dict.ParamsDict) and hasattr(\n            self.__dict__[k], '_override'\n        ):\n          self.__dict__[k]._override(v.as_dict(), is_strict)  # pylint: disable=protected-access\n        else:\n          self._set(k, v)\n\n  def as_dict(self):\n    \"\"\"Returns a dict representation of params_dict.ParamsDict.\n","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/modeling/hyperparams/base_config.py#L281-L317","documentation":"Error \"The key {!r} does not exist in {!r}. To extend the existing keys, use `override` with `is_strict` = False.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/modeling/hyperparams/base_config.py:299 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":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}