mmdet/models/detectors/cascade_rcnn.py
关于管道results[‘img’]
def forward_train(self,
img,
img_meta,
gt_bboxes,
gt_labels,
gt_bboxes_ignore=None,
gt_masks=None,
proposals=None):
"""
Args:
img (Tensor): of shape (N, C, H, W) encoding input images.
Typically these should be mean centered and std scaled.
img_meta (list[dict]): list of image info dict where each dict has:
'img_shape', 'scale_factor', 'flip', and my also contain
'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
For details on the values of these keys see
`mmdet/datasets/pipelines/formatting.py:Collect`.
gt_bboxes (list[Tensor]): each item are the truth boxes for each
image in [tl_x, tl_y, br_x, br_y] format.
gt_labels (list[Tensor]): class indices corresponding to each box
gt_bboxes_ignore (None | list[Tensor]): specify which bounding
boxes can be ignored when computing the loss.
gt_masks (None | Tensor) : true segmentation masks for each box
used if the architecture supports a segmentation task.
proposals : override rpn proposals with custom proposals. Use when
`with_rpn` is False.
Returns:
dict[str, Tensor]: a dictionary of loss components
"""
cofig里 train_config里的rcnn第一个sampler改为OHEMSampler报错
TypreError loss() missing 1 required positional argument ‘pos_bboxes’
原因: mmdet/core/bbox/samplers/ohem_sampler.py里 hardming函数里的loss缺参数pos_boxes=None
loss of bbox_head 见mmdet/models/bbox_head/bbox_heads.py BBoxHead类的loss函数
loss函数里将loss_cls loss_bbox两个key分别存放在字典loss()里
更改loss在 mmdet/models/losses/cross_entropy.py register相关参数然后在__init__.py里更新
更改lr_ 相关的是在mmcv里就有写好的可选的’cosine’ 'step’等学习率