{"record":{"id":"184eac871a8a5b40","repo":"facebookresearch/detectron2","slug":"deletion-is-not-yet-a-supported-override","errorCode":null,"errorMessage":"deletion is not yet a supported override","messagePattern":"deletion is not yet a supported override","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"detectron2/config/lazy.py","lineNumber":361,"sourceCode":"                    )\n            OmegaConf.update(cfg, key, value, merge=True)\n\n        try:\n            from hydra.core.override_parser.overrides_parser import OverridesParser\n\n            has_hydra = True\n        except ImportError:\n            has_hydra = False\n\n        if has_hydra:\n            parser = OverridesParser.create()\n            overrides = parser.parse_overrides(overrides)\n            for o in overrides:\n                key = o.key_or_group\n                value = o.value()\n                if o.is_delete():\n                    # TODO support this\n                    raise NotImplementedError(\"deletion is not yet a supported override\")\n                safe_update(cfg, key, value)\n        else:\n            # Fallback. Does not support all the features and error checking like hydra.\n            for o in overrides:\n                key, value = o.split(\"=\")\n                try:\n                    value = ast.literal_eval(value)\n                except NameError:\n                    pass\n                safe_update(cfg, key, value)\n        return cfg\n\n    @staticmethod\n    def to_py(cfg, prefix: str = \"cfg.\"):\n        \"\"\"\n        Try to convert a config object into Python-like psuedo code.\n\n        Note that perfect conversion is not always possible. So the returned","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/facebookresearch/detectron2/blob/a2f4a8771ab77e8411c26b27f24f9489a28a2453/detectron2/config/lazy.py#L343-L379","documentation":"apply_overrides parses Hydra-style overrides; when an override uses the deletion syntax key~value or ~key, detectron2 explicitly raises NotImplementedError because deletion support is a TODO.","triggerScenarios":"LazyConfig.apply_overrides(cfg, ['~model.aux_head']) or a CLI arg like 'train.dataset=~' using Hydra deletion syntax.","commonSituations":"Porting Hydra command lines that use ~ deletion; attempting to remove keys before instantiating; users assuming full Hydra grammar support.","solutions":["Instead of deleting, set the key to a null/None value the config logic already handles (e.g. model.aux_head=null)","Modify the config object in Python: cfg.pop('aux_head') / OmegaConf.update with merge=False","Edit the base config file to remove the key for this experiment"],"exampleFix":"# before\nLazyConfig.apply_overrides(cfg, [\"~model.aux_head\"])\n# after\nLazyConfig.apply_overrides(cfg, [\"model.aux_head=null\"])  # downstream treats None as disabled","handlingStrategy":"validation","validationCode":"for o in overrides:\n    assert '~' not in o.split('=')[0], f\"deletion not supported: {o}\"","typeGuard":"def has_deletion_override(overrides) -> bool:\n    return any(o.strip().startswith('~') or '~' in o.split('=')[0] for o in overrides)","tryCatchPattern":null,"preventionTips":["Rewrite Hydra deletion overrides to null assignments","Mutate cfg in Python when keys must be removed","Document supported override grammar for your team's launcher"],"tags":["config-override","hydra","lazy-config","not-implemented"],"backgroundTag":"unsupported-config-override","analyzedSha":"a2f4a8771ab77e8411c26b27f24f9489a28a2453","analyzedAt":"2026-08-27T12:08:21.260Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}