open-mmlab/mmdetection · info
You are calling `simple_test_bboxes` in `dense_test_mixins`,
Error message
You are calling `simple_test_bboxes` in `dense_test_mixins`, but the `dense_test_mixins`will be deprecated soon. Please use `simple_test` instead.
What it means
Warns that the DenseTestMixins.simple_test_bboxes path is deprecated in favor of the head's unified simple_test method. The mixin still runs (it forwards feats and calls get_results) but will be removed.
Source
Thrown at mmdet/models/dense_heads/dense_test_mixins.py:44
feats (tuple[torch.Tensor]): Multi-level features from the
upstream network, each is a 4D-tensor.
img_metas (list[dict]): List of image information.
rescale (bool, optional): Whether to rescale the results.
Defaults to False.
Returns:
list[obj:`InstanceData`]: Detection results of each
image after the post process. \
Each item usually contains following keys. \
- scores (Tensor): Classification scores, has a shape
(num_instance,)
- labels (Tensor): Labels of bboxes, has a shape
(num_instances,).
- bboxes (Tensor): Has a shape (num_instances, 4),
the last dimension 4 arrange as (x1, y1, x2, y2).
"""
warnings.warn('You are calling `simple_test_bboxes` in '
'`dense_test_mixins`, but the `dense_test_mixins`'
'will be deprecated soon. Please use '
'`simple_test` instead.')
outs = self.forward(feats)
results_list = self.get_results(
*outs, img_metas=img_metas, rescale=rescale)
return results_list
def aug_test_bboxes(self, feats, img_metas, rescale=False):
"""Test det bboxes with test time augmentation, can be applied in
DenseHead except for ``RPNHead`` and its variants, e.g., ``GARPNHead``,
etc.
Args:
feats (list[Tensor]): the outer list indicates test-time
augmentations and inner Tensor should have a shape NxCxHxW,
which contains features for all images in the batch.
img_metas (list[list[dict]]): the outer list indicates test-timeView on GitHub (pinned to cfd5d3a985)
Solutions
- Switch to head.simple_test(feats, img_metas, rescale=True) which returns results_list
- Refactor custom heads to override simple_test rather than mixin methods
Example fix
# before bboxes, labels = self.bbox_head.simple_test_bboxes(feats, img_metas, ...) # after results_list = self.bbox_head.simple_test(feats, img_metas, rescale=True)
Defensive patterns
Strategy: validation
Validate before calling
assert not hasattr(head, 'simple_test_bboxes') or hasattr(head, 'simple_test'), 'prefer simple_test' results_list = head.simple_test(feats, img_metas, rescale=True)
Type guard
def has_simple_test(head):
return callable(getattr(head, 'simple_test', None)) Prevention
- Use the detector's standard test/inference entry points rather than head mixins
When it happens
Trigger: Calling head.simple_test_bboxes(...) directly on a head that inherits DenseTestMixins (e.g. older YOLO/Retina-style heads).
Common situations: Custom test scripts or inherited head code calling simple_test_bboxes instead of the detector's standard test path.
Related errors
- You are calling `aug_test_bboxes` in `dense_test_mixins`, bu
- pretrained must be a str or None
- DeprecationWarning: pretrained is deprecated, please use "in
- DeprecationWarning: `num_anchors` is deprecated, for consist
- DeprecationWarning: anchor_generator is deprecated, please u
AI-assisted analysis of open-mmlab/mmdetection@cfd5d3a985 (2026-08-27).
Data as JSON: /api/errors/a8dd7278a468850b.
Report an issue: GitHub.