use_fine_grained_loss 开或关 算出来的 yolov3 total loss 不一样
Created by: XiminLin
我的模型参数:
YOLOv3:
backbone: ResNet
yolo_head: YOLOv3Head
ResNet:
norm_type: bn
freeze_norm: false
norm_decay: 0.
variant: d
depth: 50
dcn_v2_stages: [5]
feature_maps: [3, 4, 5]
YOLOv3Head:
anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
anchors: [[19, 29], [28, 20], [25, 40],
[31, 47], [36, 37], [41, 26],
[47, 66], [48, 33], [67, 53]]
norm_decay: 0.
yolo_loss: YOLOv3Loss
nms:
background_label: -1
keep_top_k: 100
nms_threshold: 0.45
nms_top_k: 1000
normalized: false
score_threshold: 0.01
YOLOv3Loss:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size: 8
ignore_thresh: 0.7 # default is 0.7
label_smooth: true
我在 use_fine_grained_loss 的设置如下:
- !Gt2YoloTarget
anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
anchors: [[10, 13], [16, 30], [33, 23],
[30, 61], [62, 45], [59, 119],
[116, 90], [156, 198], [373, 326]]
downsample_ratios: [32, 16, 8]
我用 pretrained weights 得到的 output (use_fine_grained_loss=true):
2020-08-20 11:21:00,054-INFO: iter: 0, lr: 0.000100, 'loss_xy': '11.305380', 'loss_wh': '5.507521', 'loss_obj': '66.596405', 'loss_cls': '0.698010', 'loss': '84.107315', time: 0.000, eta: 0:00:00
2020-08-20 11:21:24,467-INFO: iter: 1, lr: 0.000100, 'loss_xy': '11.817931', 'loss_wh': '5.780123', 'loss_obj': '63.548248', 'loss_cls': '0.411505', 'loss': '81.557808', time: 12.749, eta: 0:00:50
我用 pretrained weights 得到的 output (use_fine_grained_loss=false):
2020-08-20 11:42:41,885-INFO: iter: 0, lr: 0.000100, 'loss': '13.517960', time: 0.000, eta: 0:00:00
2020-08-20 11:43:07,319-INFO: iter: 1, lr: 0.000100, 'loss': '14.360963', time: 12.793, eta: 0:00:51
谢谢