{"record":{"id":"9c8e1610a5b669c7","repo":"open-mmlab/mmdetection","slug":"deprecationwarning-bboxes-is-deprecated-please-u","errorCode":null,"errorMessage":"DeprecationWarning: bboxes is deprecated, please use \"priors\" instead","messagePattern":"DeprecationWarning: bboxes is deprecated, please use \"priors\" instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/models/task_modules/samplers/sampling_result.py","lineNumber":126,"sourceCode":"        box_dim = gt_bboxes.box_dim if isinstance(gt_bboxes, BaseBoxes) else 4\n        if gt_bboxes.numel() == 0:\n            # hack for index error case\n            assert self.pos_assigned_gt_inds.numel() == 0\n            self.pos_gt_bboxes = gt_bboxes.view(-1, box_dim)\n        else:\n            if len(gt_bboxes.shape) < 2:\n                gt_bboxes = gt_bboxes.view(-1, box_dim)\n            self.pos_gt_bboxes = gt_bboxes[self.pos_assigned_gt_inds.long()]\n\n    @property\n    def priors(self):\n        \"\"\"torch.Tensor: concatenated positive and negative priors\"\"\"\n        return cat_boxes([self.pos_priors, self.neg_priors])\n\n    @property\n    def bboxes(self):\n        \"\"\"torch.Tensor: concatenated positive and negative boxes\"\"\"\n        warnings.warn('DeprecationWarning: bboxes is deprecated, '\n                      'please use \"priors\" instead')\n        return self.priors\n\n    @property\n    def pos_bboxes(self):\n        warnings.warn('DeprecationWarning: pos_bboxes is deprecated, '\n                      'please use \"pos_priors\" instead')\n        return self.pos_priors\n\n    @property\n    def neg_bboxes(self):\n        warnings.warn('DeprecationWarning: neg_bboxes is deprecated, '\n                      'please use \"neg_priors\" instead')\n        return self.neg_priors\n\n    def to(self, device):\n        \"\"\"Change the device of the data inplace.\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/models/task_modules/samplers/sampling_result.py#L108-L144","documentation":"Deprecation warning from SamplingResult.bboxes property: the bboxes/pos_bboxes/neg_bboxes attributes were renamed to priors/pos_priors/neg_priors because sampled 'boxes' are actually the prior anchors. The property just forwards to self.priors and will be removed.","triggerScenarios":"Accessing sampling_result.bboxes in custom sampler/roi-head code or tests; anything consuming SamplingResult output written against the old attribute names.","commonSituations":"Custom RoI heads or debugging code reading result.bboxes / result.pos_bboxes after mmdet renamed sampling fields to priors.","solutions":["Use sampling_result.priors instead of .bboxes","Similarly switch pos_bboxes→pos_priors, neg_bboxes→neg_priors (warnings 317/318)","Grep codebase for '_bboxes' usages on SamplingResult objects"],"exampleFix":"# before\nrois = sampling_result.bboxes\n# after\nrois = sampling_result.priors","handlingStrategy":"type-guard","validationCode":"assert hasattr(result, 'priors'), 'SamplingResult lacks priors; upgrade mmdet'","typeGuard":"def get_priors(result):\n    return result.priors if hasattr(result, 'priors') else result.bboxes","tryCatchPattern":null,"preventionTips":["Consume SamplingResult via priors/pos_priors/neg_priors","Feature-detect attributes when supporting multiple mmdet versions"],"tags":["mmdet","deprecation","sampling-result","priors"],"backgroundTag":"deprecated-api-renamed","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}