YOLOP icon indicating copy to clipboard operation
YOLOP copied to clipboard

训练车道线和车辆目标检测,该怎么修改config中的default?

Open zhangshengpeng2021 opened this issue 2 years ago • 6 comments

训练车道线和车辆目标检测,该怎么修改config中的default?

zhangshengpeng2021 avatar Nov 18 '22 08:11 zhangshengpeng2021

You need to add a new flag, this will train only detection branch and lane lines (encoder and drivable area will be freezed)

Change 1

Alternating optimization

_C.TRAIN.SEG_ONLY = False # Only train two segmentation branchs _C.TRAIN.DET_ONLY = False # Only train detection branch _C.TRAIN.ENC_SEG_ONLY = False # Only train encoder and two segmentation branchs _C.TRAIN.ENC_DET_ONLY = False # Only train encoder and detection branch

Single task

_C.TRAIN.DRIVABLE_ONLY = False # Only train da_segmentation task _C.TRAIN.LANE_ONLY = False # Only train ll_segmentation task _C.TRAIN.DET_ONLY = False # Only train detection task

Add this line in config/default.py _C.TRAIN.LANE_AND_DETECTION_ONLY = True

Change2 Add this part in tools/train.py if cfg.TRAIN.LANE_AND_DETECTION_ONLY: logger.info('freeze encoder and Da_Seg heads...') # print(model.named_parameters) for k, v in model.named_parameters(): v.requires_grad = True # train all layers if k.split(".")[1] in Encoder_para_idx + Da_Seg_Head_para_idx : print('freezing %s' % k) v.requires_grad = False

Change3 Add this part in lib/core/loss.py in _forward_impl function : if cfg.LANE_AND_DETECTION_ONLY: lseg_da = 0 * lseg_da

LuthraBhomik avatar Nov 20 '22 14:11 LuthraBhomik

Thank you!

zhangshengpeng2021 avatar Nov 24 '22 13:11 zhangshengpeng2021

Thank you!

wpybilibilibilibili avatar Jan 27 '23 02:01 wpybilibilibilibili

车道线的Acc上不去,Lane line Segment: Acc(0.045) IOU (0.016) mIOU(0.491)

cuiyong127 avatar May 03 '23 12:05 cuiyong127

车道线的Acc上不去,Lane line Segment: Acc(0.045) IOU (0.016) mIOU(0.491)

你好,能加一下你的联系方式吗,希望能一起探讨问题

wxzb625 avatar May 05 '23 11:05 wxzb625

车道线的Acc上不去,Lane line Segment: Acc(0.045) IOU (0.016) mIOU(0.491)

你好,能加一下你的联系方式吗,希望能一起探讨问题 好的,非常感谢你的回复 QQ: 359894979

cuiyong127 avatar May 06 '23 14:05 cuiyong127