{"record":{"id":"1108564a487e260a","repo":"facebookresearch/detectron2","slug":"anchor-boundary-thresh-is-a-legacy-option-not-impl","errorCode":null,"errorMessage":"anchor_boundary_thresh is a legacy option not implemented for RRPN.","messagePattern":"anchor_boundary_thresh is a legacy option not implemented for RRPN\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"detectron2/modeling/proposal_generator/rrpn.py","lineNumber":140,"sourceCode":"\n        res = Instances(image_size)\n        res.proposal_boxes = boxes[keep]\n        res.objectness_logits = scores_per_img[keep]\n        results.append(res)\n    return results\n\n\n@PROPOSAL_GENERATOR_REGISTRY.register()\nclass RRPN(RPN):\n    \"\"\"\n    Rotated Region Proposal Network described in :paper:`RRPN`.\n    \"\"\"\n\n    @configurable\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        if self.anchor_boundary_thresh >= 0:\n            raise NotImplementedError(\n                \"anchor_boundary_thresh is a legacy option not implemented for RRPN.\"\n            )\n\n    @classmethod\n    def from_config(cls, cfg, input_shape: Dict[str, ShapeSpec]):\n        ret = super().from_config(cfg, input_shape)\n        ret[\"box2box_transform\"] = Box2BoxTransformRotated(weights=cfg.MODEL.RPN.BBOX_REG_WEIGHTS)\n        return ret\n\n    @torch.no_grad()\n    def label_and_sample_anchors(self, anchors: List[RotatedBoxes], gt_instances: List[Instances]):\n        \"\"\"\n        Args:\n            anchors (list[RotatedBoxes]): anchors for each feature map.\n            gt_instances: the ground-truth instances for each image.\n\n        Returns:\n            list[Tensor]:","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/facebookresearch/detectron2/blob/a2f4a8771ab77e8411c26b27f24f9489a28a2453/detectron2/modeling/proposal_generator/rrpn.py#L122-L158","documentation":"RRPN (Rotated RPN) does not support the legacy anchor_boundary_thresh option. The constructor explicitly rejects any non-negative value because clipping anchors to image boundaries was never ported to the rotated proposal generator.","triggerScenarios":"Constructing an RRPN (e.g. via cfg.MODEL.PROPOSAL_GENERATOR.NAME = 'RRPN') with cfg.MODEL.RPN.BOUNDARY_THRESH >= 0, then building the model; __init__ raises immediately.","commonSituations":"Copying a config from a standard Detectron/Faster R-CNN setup that sets SOLVER/RPN.BOUNDARY_THRESH, or using rotated-box detection (RRPN) with an old config dump.","solutions":["Set cfg.MODEL.RPN.BOUNDARY_THRESH = -1 to disable boundary clipping (the only supported value for RRPN)","Remove the BOUNDARY_THRESH key from your config","Use RPN instead of RRPN if boundary clipping is required"],"exampleFix":"# before\ncfg.MODEL.RPN.BOUNDARY_THRESH = 10\n# after\ncfg.MODEL.RPN.BOUNDARY_THRESH = -1","handlingStrategy":"validation","validationCode":"assert cfg.MODEL.RPN.BOUNDARY_THRESH == -1 or cfg.MODEL.PROPOSAL_GENERATOR.NAME != 'RRPN', 'RRPN requires BOUNDARY_THRESH = -1'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate proposal generator name against anchor options before build_model","Keep rotated-detction configs separate from axis-aligned configs"],"tags":["detectron2","rrpn","config","anchors"],"backgroundTag":"unsupported-config-option","analyzedSha":"a2f4a8771ab77e8411c26b27f24f9489a28a2453","analyzedAt":"2026-08-27T12:08:21.260Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}