You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using a sampler (like RandomSampler) with add_gt_as_proposals=True in an AnchorHead (like RPNHead), sometimes theres is a crash because of out of range accesses
Reproduction
What command or script did you run?
python tools/train.py config.py
with a FasterRCNN in the config, and a RandomSampler with add_gt_as_proposals=True in the train_cfg for the rpn :
The rest of the code uses the anchors previously computed. But if add_gt_as_proposals=True in the sampler, the sampler appends the GT in its internal anchor list, so it becomes longer, and thus sampling_result.pos_inds and sampling_result.neg_inds can contain indices >= len(anchors)
If you fix that, you still have issues with anchor_head.py line 415, because images_to_levels expects the lists to be the same length accross all images
The text was updated successfully, but these errors were encountered:
Thanks for your error report and we appreciate it a lot.
Checklist
Describe the bug
When using a sampler (like RandomSampler) with add_gt_as_proposals=True in an AnchorHead (like RPNHead), sometimes theres is a crash because of out of range accesses
Reproduction
with a FasterRCNN in the config, and a RandomSampler with add_gt_as_proposals=True in the train_cfg for the rpn :
Yes and yes
Custom one
Environment
python mmdet/utils/collect_env.py
to collect necessary environment information and paste it here.sys.platform: linux
Python: 3.7.10 (default, Feb 26 2021, 18:47:35) [GCC 7.3.0]
CUDA available: False
MUSA available: False
numpy_random_seed: 2147483648
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.9.0
PyTorch compiling details: PyTorch built with:
TorchVision: 0.10.0
OpenCV: 4.10.0
MMEngine: 0.10.6
MMDetection: 3.3.0+78cf2bc
$PATH
,$LD_LIBRARY_PATH
,$PYTHONPATH
, etc.)I used the Dockerfile from MMDetection with
ARG PYTORCH="1.9.0"
ARG CUDA="11.1"
ARG CUDNN="8"
Error traceback
Error happens randomly in long trainings, I don't have the exact message noted
It said out of array access in anchor_head.py at line 292
Bug fix
The reason is that in AnchorHead , in method _get_targets_single, we have
The rest of the code uses the anchors previously computed. But if add_gt_as_proposals=True in the sampler, the sampler appends the GT in its internal anchor list, so it becomes longer, and thus sampling_result.pos_inds and sampling_result.neg_inds can contain indices >= len(anchors)
If you fix that, you still have issues with anchor_head.py line 415, because images_to_levels expects the lists to be the same length accross all images
The text was updated successfully, but these errors were encountered: