Focal and Global Knowledge Distillation for Detectors

Related tags

Deep Learning FGD
Overview

FGD

Paper: Focal and Global Knowledge Distillation for Detectors

Install MMDetection and MS COCO2017

  • Our codes are based on MMDetection. Please follow the installation of MMDetection and make sure you can run it successfully.
  • This repo uses mmdet==2.11.0 and mmcv-full==1.2.4

Add and Replace the codes

  • Add the configs/. in our codes to the configs/ in mmdetectin's codes.
  • Add the mmdet/distillation/. in our codes to the mmdet/ in mmdetectin's codes.
  • Replace the mmdet/apis/train.py and tools/train.py in mmdetection's codes with mmdet/apis/train.py and tools/train.py in our codes.
  • Add pth_transfer.py to mmdetection's codes.
  • Unzip COCO dataset into data/coco/

Train

#single GPU
python tools/train.py configs/distillers/fgd/fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py

#multi GPU
bash tools/dist_train.sh configs/distillers/fgd/fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py 8

Transfer

# Tansfer the FGD model into mmdet model
python pth_transfer.py --fgd_path $fgd_ckpt --output_path $new_mmdet_ckpt

Test

#single GPU
python tools/test.py configs/retinanet/retinanet_r50_fpn_2x_coco.py $new_mmdet_ckpt --eval bbox

#multi GPU
bash tools/dist_test.sh configs/retinanet/retinanet_r50_fpn_2x_coco.py $new_mmdet_ckpt 8 --eval bbox

Results

Model Backbone mAP config weight code
RetinaNet ResNet-50 40.7 config baidu wsfw
RetinaNet ResNet-101 41.7 config
Faster RCNN ResNet-50 42.0 config baidu dgpf
Faster RCNN ResNet-101 44.1 config
RepPoints ResNet-50 42.0 config baidu qx5d
RepPoints ResNet-101 43.8 config
FCOS ResNet-50 42.7 config baidu sedt
MaskRCNN ResNet-50 42.1 config baidu sv8m

Acknowledgement

Our code is based on the project MMDetection.

Thanks to the work GCNet and mmetection-distiller.

Comments
  • mAP为0

    mAP为0

    我在coco数据集上用yoloxm蒸馏yoloxs,损失曲线也正常,但是第一个epoch,精度为0,我已经按照reademe一步一步改了,之前是在自己数据集上精度为0,我想排查下到底哪里有问题,就在coco上进行了实验,发现在coco上也是同样问题。请问我这可能是哪里的问题那,已经困扰我很多天了。。。。 1665288123524 1665288158590 1665288178548

    opened by baibaidedongdong 16
  • Testing result

    Testing result

    Hi, I have runnd faster_rcnn_res50 for detection and mask_rcnn_res50 for segmentation, all configs are same with paper, I got bbox_mAP 40.8 and segm_mAP 36.6, witch is a gap with paper bbox_mAP 42.0 and segm_mAP 37.8. I want to know your benchmark running once or several times pick out best results? Thank your~

    opened by peiyingxin 6
  • Training log update

    Training log update

    thanks for sharing your excellent job! can you update your training logs? when I have runned configs/distillers/fgd/fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py , I only got 30.4 mAP Epoch(val) [24][625] bbox_mAP: 0.3040, bbox_mAP_50: 0.4980, bbox_mAP_75: 0.3140, bbox_mAP_s: 0.1640, bbox_mAP_m: 0.3300, bbox_mAP_l: 0.4160, bbox_mAP_copypaste: 0.304 0.498 0.314 0.164 0.330 0.416

    I don't konw why thank your~

    opened by peiyingxin 6
  • the result of solov2 model after distiller is reduced

    the result of solov2 model after distiller is reduced

    Hi,Thanks your great work I use FDG in solov2, the teacher model is solov2-resNet101 and the student model is solov2-mobileNetV2 the train log is below: 20220520_164942.log and the config file is below: fgd_solov2_r101_c8_ms_distill_solov2_mobileNetV2_slim_c8_txt.txt I compared the mAP between solov2-mobileNetV2 distiller model and no distiller model, but the result is not ideal. the mAP of solov2-mobileNetV2 model (0.465) ,which is higher than the distiller model (0.426) why the accuary of the distiller model reduced ?

    opened by Evoluange 6
  • Add DCN

    Add DCN

    Hello, Thank you for your insight work! I have a question when I add a DCN structure for the teacher or student, e.g, faster_rcnn_r50_fpn_dconv_c3-c5, cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5, loss_fgd_fpn and total loss will become too large to train? I am wondering the reason behind it.

    Here is the log output:

    2022-10-10 15:07:23,967 - mmdet - INFO - Epoch [1][50/16178]	lr: 9.890e-04, eta: 3 days, 7:50:51, time: 1.481, data_time: 0.072, memory: 11330, loss_cls: 0.6365, loss_bbox: 0.6870, loss_dfl: 0.3843, loss_fgd_fpn_4: 0.0002, loss_fgd_fpn_3: 0.0181, loss_fgd_fpn_2: 0.1217, loss_fgd_fpn_1: 1.3931, loss_fgd_fpn_0: 6.3135, loss: 9.5544, grad_norm: 68.6224
    2022-10-10 15:08:34,256 - mmdet - INFO - Epoch [1][100/16178]	lr: 1.988e-03, eta: 3 days, 5:47:53, time: 1.406, data_time: 0.010, memory: 11331, loss_cls: 0.5288, loss_bbox: 0.5811, loss_dfl: 0.3424, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0081, loss_fgd_fpn_2: 0.0561, loss_fgd_fpn_1: 0.9112, loss_fgd_fpn_0: 4.2769, loss: 6.7047, grad_norm: 23.8445
    2022-10-10 15:09:45,544 - mmdet - INFO - Epoch [1][150/16178]	lr: 2.987e-03, eta: 3 days, 5:27:40, time: 1.426, data_time: 0.010, memory: 11332, loss_cls: 0.5084, loss_bbox: 0.5301, loss_dfl: 0.3167, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0086, loss_fgd_fpn_2: 0.0718, loss_fgd_fpn_1: 1.0272, loss_fgd_fpn_0: 4.8596, loss: 7.3225, grad_norm: 37.7240
    2022-10-10 15:10:57,655 - mmdet - INFO - Epoch [1][200/16178]	lr: 3.986e-03, eta: 3 days, 5:30:15, time: 1.442, data_time: 0.010, memory: 11332, loss_cls: 0.5128, loss_bbox: 0.5244, loss_dfl: 0.3146, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0079, loss_fgd_fpn_2: 0.0572, loss_fgd_fpn_1: 1.0461, loss_fgd_fpn_0: 4.8641, loss: 7.3272, grad_norm: 30.0396
    2022-10-10 15:12:08,429 - mmdet - INFO - Epoch [1][250/16178]	lr: 4.985e-03, eta: 3 days, 5:14:02, time: 1.415, data_time: 0.010, memory: 11332, loss_cls: 0.5229, loss_bbox: 0.5141, loss_dfl: 0.3086, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0068, loss_fgd_fpn_2: 0.0506, loss_fgd_fpn_1: 0.8142, loss_fgd_fpn_0: 3.9057, loss: 6.1230, grad_norm: 12.6570
    2022-10-10 15:13:19,710 - mmdet - INFO - Epoch [1][300/16178]	lr: 5.984e-03, eta: 3 days, 5:08:18, time: 1.426, data_time: 0.010, memory: 11332, loss_cls: 0.4991, loss_bbox: 0.5199, loss_dfl: 0.3110, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0072, loss_fgd_fpn_2: 0.0523, loss_fgd_fpn_1: 0.8164, loss_fgd_fpn_0: 3.7634, loss: 5.9694, grad_norm: 11.5621
    2022-10-10 15:14:30,729 - mmdet - INFO - Epoch [1][350/16178]	lr: 6.983e-03, eta: 3 days, 5:01:27, time: 1.420, data_time: 0.010, memory: 11332, loss_cls: 0.5207, loss_bbox: 0.5134, loss_dfl: 0.3113, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0073, loss_fgd_fpn_2: 0.0541, loss_fgd_fpn_1: 0.8442, loss_fgd_fpn_0: 4.1035, loss: 6.3546, grad_norm: 13.2545
    2022-10-10 15:15:41,433 - mmdet - INFO - Epoch [1][400/16178]	lr: 7.982e-03, eta: 3 days, 4:53:28, time: 1.414, data_time: 0.010, memory: 11332, loss_cls: 0.4979, loss_bbox: 0.5297, loss_dfl: 0.3136, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0070, loss_fgd_fpn_2: 0.0515, loss_fgd_fpn_1: 0.7945, loss_fgd_fpn_0: 3.7389, loss: 5.9332, grad_norm: 8.9079
    2022-10-10 15:16:52,334 - mmdet - INFO - Epoch [1][450/16178]	lr: 8.981e-03, eta: 3 days, 4:48:25, time: 1.418, data_time: 0.010, memory: 11332, loss_cls: 0.5142, loss_bbox: 0.5102, loss_dfl: 0.3119, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0068, loss_fgd_fpn_2: 0.0489, loss_fgd_fpn_1: 0.7655, loss_fgd_fpn_0: 3.7806, loss: 5.9382, grad_norm: 9.4913
    2022-10-10 15:18:03,443 - mmdet - INFO - Epoch [1][500/16178]	lr: 9.980e-03, eta: 3 days, 4:45:28, time: 1.422, data_time: 0.010, memory: 11332, loss_cls: 0.5051, loss_bbox: 0.5061, loss_dfl: 0.3060, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0071, loss_fgd_fpn_2: 0.0511, loss_fgd_fpn_1: 0.7981, loss_fgd_fpn_0: 3.7618, loss: 5.9355, grad_norm: 9.1807
    2022-10-10 15:19:14,859 - mmdet - INFO - Epoch [1][550/16178]	lr: 1.000e-02, eta: 3 days, 4:44:39, time: 1.428, data_time: 0.010, memory: 11332, loss_cls: 0.5116, loss_bbox: 0.4758, loss_dfl: 0.2929, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0071, loss_fgd_fpn_2: 0.0524, loss_fgd_fpn_1: 0.7696, loss_fgd_fpn_0: 3.6697, loss: 5.7791, grad_norm: 10.2593
    2022-10-10 15:20:26,284 - mmdet - INFO - Epoch [1][600/16178]	lr: 1.000e-02, eta: 3 days, 4:43:49, time: 1.428, data_time: 0.010, memory: 11332, loss_cls: 0.5084, loss_bbox: 0.5035, loss_dfl: 0.3048, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0074, loss_fgd_fpn_2: 0.0538, loss_fgd_fpn_1: 0.8274, loss_fgd_fpn_0: 3.9499, loss: 6.1554, grad_norm: 11.5289
    2022-10-10 15:21:38,146 - mmdet - INFO - Epoch [1][650/16178]	lr: 1.000e-02, eta: 3 days, 4:45:06, time: 1.437, data_time: 0.010, memory: 11332, loss_cls: 0.5201, loss_bbox: 0.5220, loss_dfl: 0.3139, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0105, loss_fgd_fpn_2: 0.0730, loss_fgd_fpn_1: 0.8779, loss_fgd_fpn_0: 4.0663, loss: 6.3838, grad_norm: 12.7775
    2022-10-10 15:22:49,456 - mmdet - INFO - Epoch [1][700/16178]	lr: 1.000e-02, eta: 3 days, 4:43:29, time: 1.426, data_time: 0.010, memory: 11332, loss_cls: 0.5132, loss_bbox: 0.5461, loss_dfl: 0.3226, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0079, loss_fgd_fpn_2: 0.0564, loss_fgd_fpn_1: 0.8152, loss_fgd_fpn_0: 3.8834, loss: 6.1450, grad_norm: 11.4293
    2022-10-10 15:24:00,110 - mmdet - INFO - Epoch [1][750/16178]	lr: 1.000e-02, eta: 3 days, 4:39:06, time: 1.413, data_time: 0.010, memory: 11332, loss_cls: 0.5316, loss_bbox: 0.5172, loss_dfl: 0.3141, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0076, loss_fgd_fpn_2: 0.0548, loss_fgd_fpn_1: 0.8379, loss_fgd_fpn_0: 3.9216, loss: 6.1849, grad_norm: 8.1157
    2022-10-10 15:25:11,329 - mmdet - INFO - Epoch [1][800/16178]	lr: 1.000e-02, eta: 3 days, 4:37:24, time: 1.424, data_time: 0.010, memory: 11332, loss_cls: 0.4892, loss_bbox: 0.4858, loss_dfl: 0.2968, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0069, loss_fgd_fpn_2: 0.0519, loss_fgd_fpn_1: 0.7800, loss_fgd_fpn_0: 3.5984, loss: 5.7091, grad_norm: 7.2720
    2022-10-10 15:26:21,786 - mmdet - INFO - Epoch [1][850/16178]	lr: 1.000e-02, eta: 3 days, 4:32:53, time: 1.409, data_time: 0.010, memory: 11332, loss_cls: 0.5169, loss_bbox: 0.5149, loss_dfl: 0.3076, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0076, loss_fgd_fpn_2: 0.0551, loss_fgd_fpn_1: 0.8749, loss_fgd_fpn_0: 3.9996, loss: 6.2768, grad_norm: 11.8264
    2022-10-10 15:27:32,728 - mmdet - INFO - Epoch [1][900/16178]	lr: 1.000e-02, eta: 3 days, 4:30:27, time: 1.419, data_time: 0.010, memory: 11332, loss_cls: 0.5167, loss_bbox: 0.4732, loss_dfl: 0.2936, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0070, loss_fgd_fpn_2: 0.0519, loss_fgd_fpn_1: 0.7775, loss_fgd_fpn_0: 3.6971, loss: 5.8172, grad_norm: 8.8075
    2022-10-10 15:28:44,486 - mmdet - INFO - Epoch [1][950/16178]	lr: 1.000e-02, eta: 3 days, 4:30:56, time: 1.435, data_time: 0.010, memory: 11332, loss_cls: 0.4985, loss_bbox: 0.4969, loss_dfl: 0.3020, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0066, loss_fgd_fpn_2: 0.0498, loss_fgd_fpn_1: 0.7534, loss_fgd_fpn_0: 3.6059, loss: 5.7131, grad_norm: 7.6654
    2022-10-10 15:29:55,254 - mmdet - INFO - Epoch [1][1000/16178]	lr: 1.000e-02, eta: 3 days, 4:28:03, time: 1.415, data_time: 0.010, memory: 11332, loss_cls: 0.4810, loss_bbox: 0.5045, loss_dfl: 0.3053, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0063, loss_fgd_fpn_2: 0.0447, loss_fgd_fpn_1: 0.6467, loss_fgd_fpn_0: 3.1656, loss: 5.1542, grad_norm: 6.4960
    2022-10-10 15:31:05,415 - mmdet - INFO - Epoch [1][1050/16178]	lr: 1.000e-02, eta: 3 days, 4:23:28, time: 1.403, data_time: 0.010, memory: 11332, loss_cls: 0.5539, loss_bbox: 0.5281, loss_dfl: 0.3202, loss_fgd_fpn_4: 0.0002, loss_fgd_fpn_3: 0.0451, loss_fgd_fpn_2: 0.2862, loss_fgd_fpn_1: 10.4438, loss_fgd_fpn_0: 30.4854, loss: 42.6630, grad_norm: 3034.1699
    2022-10-10 15:32:16,896 - mmdet - INFO - Epoch [1][1100/16178]	lr: 1.000e-02, eta: 3 days, 4:23:04, time: 1.430, data_time: 0.010, memory: 11332, loss_cls: 0.5293, loss_bbox: 0.5076, loss_dfl: 0.3075, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0076, loss_fgd_fpn_2: 0.0534, loss_fgd_fpn_1: 0.8656, loss_fgd_fpn_0: 3.8698, loss: 6.1410, grad_norm: 15.3256
    2022-10-10 15:33:27,140 - mmdet - INFO - Epoch [1][1150/16178]	lr: 1.000e-02, eta: 3 days, 4:19:08, time: 1.405, data_time: 0.010, memory: 11332, loss_cls: 0.5029, loss_bbox: 0.4510, loss_dfl: 0.2841, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0064, loss_fgd_fpn_2: 0.0465, loss_fgd_fpn_1: 0.6350, loss_fgd_fpn_0: 3.1598, loss: 5.0856, grad_norm: 6.5924
    2022-10-10 15:34:37,744 - mmdet - INFO - Epoch [1][1200/16178]	lr: 1.000e-02, eta: 3 days, 4:16:23, time: 1.412, data_time: 0.010, memory: 11332, loss_cls: 0.4919, loss_bbox: 0.4949, loss_dfl: 0.3020, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0075, loss_fgd_fpn_2: 0.0529, loss_fgd_fpn_1: 0.7247, loss_fgd_fpn_0: 3.5468, loss: 5.6208, grad_norm: 6.6782
    2022-10-10 15:35:48,395 - mmdet - INFO - Epoch [1][1250/16178]	lr: 1.000e-02, eta: 3 days, 4:13:54, time: 1.413, data_time: 0.010, memory: 11332, loss_cls: 0.5052, loss_bbox: 0.4780, loss_dfl: 0.2934, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0071, loss_fgd_fpn_2: 0.0507, loss_fgd_fpn_1: 0.6617, loss_fgd_fpn_0: 3.1991, loss: 5.1952, grad_norm: 7.1381
    2022-10-10 15:36:59,383 - mmdet - INFO - Epoch [1][1300/16178]	lr: 1.000e-02, eta: 3 days, 4:12:20, time: 1.420, data_time: 0.010, memory: 11332, loss_cls: 0.4702, loss_bbox: 0.4689, loss_dfl: 0.2900, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0067, loss_fgd_fpn_2: 0.0483, loss_fgd_fpn_1: 0.6287, loss_fgd_fpn_0: 3.1048, loss: 5.0178, grad_norm: 6.6730
    2022-10-10 15:38:09,195 - mmdet - INFO - Epoch [1][1350/16178]	lr: 1.000e-02, eta: 3 days, 4:08:00, time: 1.396, data_time: 0.010, memory: 11332, loss_cls: 0.5176, loss_bbox: 0.4569, loss_dfl: 0.2849, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0062, loss_fgd_fpn_2: 0.0443, loss_fgd_fpn_1: 0.5653, loss_fgd_fpn_0: 2.8550, loss: 4.7303, grad_norm: 6.2432
    2022-10-10 15:39:19,317 - mmdet - INFO - Epoch [1][1400/16178]	lr: 1.000e-02, eta: 3 days, 4:04:37, time: 1.402, data_time: 0.010, memory: 11332, loss_cls: 0.4808, loss_bbox: 0.4700, loss_dfl: 0.2906, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0062, loss_fgd_fpn_2: 0.0451, loss_fgd_fpn_1: 0.5628, loss_fgd_fpn_0: 2.8688, loss: 4.7243, grad_norm: 5.8212
    2022-10-10 15:40:29,784 - mmdet - INFO - Epoch [1][1450/16178]	lr: 1.000e-02, eta: 3 days, 4:02:08, time: 1.409, data_time: 0.010, memory: 11332, loss_cls: 0.4922, loss_bbox: 0.4429, loss_dfl: 0.2802, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0061, loss_fgd_fpn_2: 0.0443, loss_fgd_fpn_1: 0.5911, loss_fgd_fpn_0: 2.9405, loss: 4.7974, grad_norm: 7.1132
    2022-10-10 15:41:40,482 - mmdet - INFO - Epoch [1][1500/16178]	lr: 1.000e-02, eta: 3 days, 4:00:15, time: 1.414, data_time: 0.010, memory: 11332, loss_cls: 0.4567, loss_bbox: 0.4931, loss_dfl: 0.3016, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0066, loss_fgd_fpn_2: 0.0472, loss_fgd_fpn_1: 0.6008, loss_fgd_fpn_0: 2.9786, loss: 4.8846, grad_norm: 6.0787
    2022-10-10 15:42:51,679 - mmdet - INFO - Epoch [1][1550/16178]	lr: 1.000e-02, eta: 3 days, 3:59:26, time: 1.424, data_time: 0.010, memory: 11332, loss_cls: 0.4667, loss_bbox: 0.4836, loss_dfl: 0.2966, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0064, loss_fgd_fpn_2: 0.0461, loss_fgd_fpn_1: 0.6019, loss_fgd_fpn_0: 2.9062, loss: 4.8075, grad_norm: 7.3193
    2022-10-10 15:44:02,559 - mmdet - INFO - Epoch [1][1600/16178]	lr: 1.000e-02, eta: 3 days, 3:57:57, time: 1.418, data_time: 0.010, memory: 11332, loss_cls: 0.5035, loss_bbox: 0.4874, loss_dfl: 0.2984, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0208, loss_fgd_fpn_2: 0.1415, loss_fgd_fpn_1: 12.0289, loss_fgd_fpn_0: 22.1169, loss: 35.5976, grad_norm: 9077.5504
    2022-10-10 15:45:13,235 - mmdet - INFO - Epoch [1][1650/16178]	lr: 1.000e-02, eta: 3 days, 3:56:06, time: 1.414, data_time: 0.010, memory: 11332, loss_cls: 0.4893, loss_bbox: 0.4638, loss_dfl: 0.2870, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0065, loss_fgd_fpn_2: 0.0473, loss_fgd_fpn_1: 0.6394, loss_fgd_fpn_0: 3.2284, loss: 5.1618, grad_norm: 46.0868
    2022-10-10 15:46:23,125 - mmdet - INFO - Epoch [1][1700/16178]	lr: 1.000e-02, eta: 3 days, 3:52:48, time: 1.398, data_time: 0.010, memory: 11332, loss_cls: 0.4880, loss_bbox: 0.4438, loss_dfl: 0.2836, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0061, loss_fgd_fpn_2: 0.0430, loss_fgd_fpn_1: 0.5120, loss_fgd_fpn_0: 2.5668, loss: 4.3435, grad_norm: 5.6961
    2022-10-10 15:47:34,943 - mmdet - INFO - Epoch [1][1750/16178]	lr: 1.000e-02, eta: 3 days, 3:53:10, time: 1.436, data_time: 0.010, memory: 11332, loss_cls: 0.4759, loss_bbox: 0.4977, loss_dfl: 0.3028, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0070, loss_fgd_fpn_2: 0.0493, loss_fgd_fpn_1: 0.6108, loss_fgd_fpn_0: 3.0078, loss: 4.9514, grad_norm: 6.7499
    2022-10-10 15:48:45,031 - mmdet - INFO - Epoch [1][1800/16178]	lr: 1.000e-02, eta: 3 days, 3:50:21, time: 1.402, data_time: 0.010, memory: 11332, loss_cls: 0.5020, loss_bbox: 0.4571, loss_dfl: 0.2838, loss_fgd_fpn_4: 0.0001, loss_fgd_fpn_3: 0.0067, loss_fgd_fpn_2: 0.0485, loss_fgd_fpn_1: 0.5821, loss_fgd_fpn_0: 2.9682, loss: 4.8486, grad_norm: 8.6155
    2022-10-10 15:49:55,865 - mmdet - INFO - Epoch [1][1850/16178]	lr: 1.000e-02, eta: 3 days, 3:48:56, time: 1.417, data_time: 0.010, memory: 11332, loss_cls: 0.5524, loss_bbox: 0.5681, loss_dfl: 0.3350, loss_fgd_fpn_4: 0.0234, loss_fgd_fpn_3: 20.7488, loss_fgd_fpn_2: 135.5364, loss_fgd_fpn_1: 4514.5350, loss_fgd_fpn_0: 5980.8744, loss: 10653.1733, grad_norm: 693299.5836
    
    opened by ywaner 5
  • the test result is 0

    the test result is 0

    Dear author, I configured my training model on MMDetection, and the bbox_mAP_50 of the validation set was preferably 0.883, but the test result was 0.My detailed steps are as follows: Add and Replace the codes 1.Add folders a_my_configs/ to the configs/ in mmdetectin's codes. 2.Add my_faster_rcnn_r50_fpn_2x_coco.py and my_faster_rcnn_r101_fpn_2x_coco.py to the configs/a_my_configs/. 3.In my_faster_rcnn_r50_fpn_2x_coco.py, base as same as configs/faster_rcnn/faster_rcnn_r50_fpn_2x_coco.py, add data=dict( samples_per_gpu=1, # batch size workers_per_gpu=1, # num_workers train=dict(path1),val=dict(path2),test=dict(path3)) 4.Modify the
    student_cfg = 'configs/a_my_configs/my_faster_rcnn_r50_fpn_2x_coco.py' teacher_cfg = 'configs/a_my_configs/my_faster_rcnn_r101_fpn_2x_coco.py' in configs/distillers/fgd/fgd_faster_rcnn_r101_fpn_2x_distill_faster_rcnn_r50_fpn_2x_coco.py Train python tools/train.py configs/distillers/fgd/fgd_faster_rcnn_r101_fpn_2x_distill_faster_rcnn_r50_fpn_2x_coco.py The training process went smoothly and the best bbox_mAP_50=0.883 Test python tools/test.py configs/a_my_configs/my_faster_rcnn_r50_fpn_2x_coco.py work_dirs/fgd_faster_rcnn_r101_fpn_2x_distill_faster_rcnn_r50_fpn_2x_coco/latest.pth --eval bbox

    But the test results(bbox_mAP,bbox_mAP_50,bbox_mAP_l……) were 0, I guess the problem appears on the configuration file, but do not know how to solve, looking forward to your reply, I can provide my complete code

    opened by AnLingla 5
  • FCOS训练及测试结果问题

    FCOS训练及测试结果问题

    作者你好,我使用FCOS框架进行蒸馏,发现训练过程中,随着epoch增加,测试结果在不断降低,不知道是不是配置的问题,能否帮帮忙看下?谢谢!

    环境配置: pytorch=1.7.1,mmdetection=2.11.0,mmcv=1.2.4,cuda=10.2

    训练命令行: bash tools/dist_train.sh configs/distillers/fgd/fgd_fcos_r101_distill_fcos_r50_2x_coco.py 2

    训练log(只包含前5个epoch): fgd_fcos.log

    opened by Hwang64 4
  • GCNet vs. Non-Local module

    GCNet vs. Non-Local module

    @yzd-v Hi, thanks for your simple and powerfull KD method. I have one question, why use GCNet rather commonly used Non-local module,
    Have you test these two OPs since GCNet is little better than Non-local.(Maybe some experiments about these two modules can be added into your paper, since this is one question reviewers intuitively will ask)

    opened by Senwang98 4
  • some confuse

    some confuse

    Thank you for open this repo. $A^S, A^C$ denote the spatial and channel attention mask of the teacher detector In formulate (9) , However $A^S_t , A^C_t $ is contrain in formulate (10). Why not fuse $A^S_t , A^C_t $ in formulate (9)?

    opened by www516717402 3
  • 为什么我运行的时候总提示 the model and loaded state dict do not match exactly?

    为什么我运行的时候总提示 the model and loaded state dict do not match exactly?

    是框架的问题吗? missing keys in source state_dict: backbone.conv1.weight, backbone.bn1.weight, backbone.bn1.bias, backbone.bn1.running_mean, backbone.bn1.running_var, backbone.layer1.0.conv1.weight, backbone.layer1.0.bn1.weight, backbone.layer1.0.bn1.bias, backbone.layer1.0.bn1.running_mean,............

    opened by chenqq1 2
  • The model and loaded state dict do not match exactly

    The model and loaded state dict do not match exactly

    load checkpoint from local path: ../tools/Retina_ResX101-50_40.7_final.pth The model and loaded state dict do not match exactly

    size mismatch for bbox_head.retina_cls.weight: copying a param with shape torch.Size([720, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([36, 256, 3, 3]). size mismatch for bbox_head.retina_cls.bias: copying a param with shape torch.Size([720]) from checkpoint, the shape in current model is torch.Size([36]).

    opened by chenqq1 2
  • A question about object detection distill

    A question about object detection distill

    Hey,bro. I wonder using two stage method like Faster-RCNN to distill one stage method like Yolo, only using neck feature to distill, will it work?what's your opinion? Thanks.

    opened by peiyingxin 0
  • 利用 FGD将两个教师模型训练一个学生模型的问题

    利用 FGD将两个教师模型训练一个学生模型的问题

    当前有两个YOLOX-l模型(分别检测抽烟(YOLOX-l-cigar)和玩手机(YOLOX-l-cellphone)),利用FGD将YOLOX-l-cigar和YOLOX-l-cellphone模型对YOLOX-m学生进行训练,训练后的模型既能检测抽烟 也能检测玩手机,有相关的示例代码或者指导吗?多谢

    opened by lixiangMindSpore 0
  • very slow training

    very slow training

    Line 86 in the forward function in mmdet/distillation/losses/fgd.py There are two for loops here, in my test, these two for loops slow down the training seriously, is there any solution?

    opened by businiaoo 3
  • AssertionError: top_pool_forward miss in module _ext

    AssertionError: top_pool_forward miss in module _ext

    Traceback (most recent call last): File "tools/train.py", line 15, in from mmdet.apis import set_random_seed, train_detector File "/home/renyu/anzhuang/anaconda3/envs/FGD/lib/python3.7/site-packages/mmdet/apis/init.py", line 2, in from .inference import (async_inference_detector, inference_detector, File "/home/renyu/anzhuang/anaconda3/envs/FGD/lib/python3.7/site-packages/mmdet/apis/inference.py", line 7, in from mmcv.ops import RoIPool File "/home/renyu/anzhuang/anaconda3/envs/FGD/lib/python3.7/site-packages/mmcv/ops/init.py", line 10, in from .corner_pool import CornerPool File "/home/renyu/anzhuang/anaconda3/envs/FGD/lib/python3.7/site-packages/mmcv/ops/corner_pool.py", line 11, in 'right_pool_forward', 'right_pool_backward' File "/home/renyu/anzhuang/anaconda3/envs/FGD/lib/python3.7/site-packages/mmcv/utils/ext_loader.py", line 15, in load_ext assert hasattr(ext, fun), f'{fun} miss in module {name}' AssertionError: top_pool_forward miss in module _ext

    opened by renyu-renyu 1
  • the results of lightweight backones

    the results of lightweight backones

    how about the results of some lightweight backones such as mobbilenetv3。I used resnet50 GFL as teacher and mobilenetv3 GFL as student but got very small improvement in my own datasets. Any guideline to these model?

    opened by maoyichun 4
Owner
Mesopotamia
Mesopotamia
[IJCAI-2021] A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation"

DataFree A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation" Authors: Gongfa

ZJU-VIPA 47 Jan 9, 2023
Official code for "Focal Self-attention for Local-Global Interactions in Vision Transformers"

Focal Transformer This is the official implementation of our Focal Transformer -- "Focal Self-attention for Local-Global Interactions in Vision Transf

Microsoft 486 Dec 20, 2022
Focal Loss for Dense Rotation Object Detection

Convert ResNets weights from GluonCV to Tensorflow Abstract GluonCV released some new resnet pre-training weights and designed some new resnets (such

null 17 Nov 24, 2021
Focal Sparse Convolutional Networks for 3D Object Detection (CVPR 2022, Oral)

Focal Sparse Convolutional Networks for 3D Object Detection (CVPR 2022, Oral) This is the official implementation of Focals Conv (CVPR 2022), a new sp

DV Lab 280 Jan 7, 2023
The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

MIC-DKFZ 1.2k Jan 4, 2023
A light weight data augmentation tool for training CNNs and Viola Jones detectors

hey-daug A light weight data augmentation tool for training CNNs and Viola Jones detectors (Haar Cascades). This tool inflates your data by up to six

Jaiyam Sharma 2 Nov 23, 2019
Official implementation for (Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching, AAAI-2021)

Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching Official pytorch implementation of "Show, Attend and Distill: Kn

Clova AI Research 80 Dec 16, 2022
TorchDistiller - a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

This project is a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

yifan liu 147 Dec 3, 2022
PocketNet: Extreme Lightweight Face Recognition Network using Neural Architecture Search and Multi-Step Knowledge Distillation

PocketNet This is the official repository of the paper: PocketNet: Extreme Lightweight Face Recognition Network using Neural Architecture Search and M

Fadi Boutros 40 Dec 22, 2022
Paper Title: Heterogeneous Knowledge Distillation for Simultaneous Infrared-Visible Image Fusion and Super-Resolution

HKDnet Paper Title: "Heterogeneous Knowledge Distillation for Simultaneous Infrared-Visible Image Fusion and Super-Resolution" Email: 18186470991@163.

wasteland 11 Nov 12, 2022
《Train in Germany, Test in The USA: Making 3D Object Detectors Generalize》(CVPR 2020)

Train in Germany, Test in The USA: Making 3D Object Detectors Generalize This paper has been accpeted by Conference on Computer Vision and Pattern Rec

Xiangyu Chen 101 Jan 2, 2023
Deep Structured Instance Graph for Distilling Object Detectors (ICCV 2021)

DSIG Deep Structured Instance Graph for Distilling Object Detectors Authors: Yixin Chen, Pengguang Chen, Shu Liu, Liwei Wang, Jiaya Jia. [pdf] [slide]

DV Lab 31 Nov 17, 2022
Project code for weakly supervised 3D object detectors using wide-baseline multi-view traffic camera data: WIBAM.

WIBAM (Work in progress) Weakly Supervised Training of Monocular 3D Object Detectors Using Wide Baseline Multi-view Traffic Camera Data 3D object dete

Matthew Howe 10 Aug 24, 2022
Official repository of the paper Privacy-friendly Synthetic Data for the Development of Face Morphing Attack Detectors

SMDD-Synthetic-Face-Morphing-Attack-Detection-Development-dataset Official repository of the paper Privacy-friendly Synthetic Data for the Development

null 10 Dec 12, 2022
Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral)

Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral) This is the official implementat

Yifan Zhang 259 Dec 25, 2022
Official implementation for (Refine Myself by Teaching Myself : Feature Refinement via Self-Knowledge Distillation, CVPR-2021)

FRSKD Official implementation for Refine Myself by Teaching Myself : Feature Refinement via Self-Knowledge Distillation (CVPR-2021) Requirements Pytho

null 75 Dec 28, 2022
Block-wisely Supervised Neural Architecture Search with Knowledge Distillation (CVPR 2020)

DNA This repository provides the code of our paper: Blockwisely Supervised Neural Architecture Search with Knowledge Distillation. Illustration of DNA

Changlin Li 215 Dec 19, 2022
AMTML-KD: Adaptive Multi-teacher Multi-level Knowledge Distillation

AMTML-KD: Adaptive Multi-teacher Multi-level Knowledge Distillation

Frank Liu 26 Oct 13, 2022
Code implementation of Data Efficient Stagewise Knowledge Distillation paper.

Data Efficient Stagewise Knowledge Distillation Table of Contents Data Efficient Stagewise Knowledge Distillation Table of Contents Requirements Image

IvLabs 112 Dec 2, 2022