yzd-v / fgd Goto Github PK
View Code? Open in Web Editor NEWFocal and Global Knowledge Distillation for Detectors (CVPR 2022)
License: Apache License 2.0
Focal and Global Knowledge Distillation for Detectors (CVPR 2022)
License: Apache License 2.0
Hi, would you be interested in adding FGD to Hugging Face as a Gradio Web Demo for CVPR 2022 call for Demos? The Hub offers free hosting, and it would make your work more accessible and visible to the rest of the ML community. Models/datasets/spaces(web demos) can be added to a user account or organization similar to github.
more info on CVPR call for demos: https://huggingface.co/CVPR
and here are guides for adding web demo to the organization
How to add a Space: https://huggingface.co/blog/gradio-spaces
Please let us know if you would be interested and if you have any questions, we can also help with the technical implementation.
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
Greetings,
This is Aman Goyal. I am currently pursuing research at CMU and MSU. I wanted to know if it is possible to perform distillation of Resnet-50 backbone on BDD100K dataset through your codebase.
Thanks
I did the distillation of fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco according to the settings in the paper, but the accuracy is lower than the baseline. I don't understand why this result occurs?
20220527_173012.log
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~
你好,我用retinaface训练自己的数据集,发现使用fgd后精度比不用低。teacher模型已验证精度,是正常的。我的teacher模型backbone是resnet50,student的backbone是mobilenetv3-small。
我将ssh后的特征层拿来计算fgd的loss,具体代码如下:
out,features = net(images)
loss_l, loss_c = criterion(out, priors, targets)
loss = cfg['loc_weight'] * loss_l + loss_c
with torch.no_grad():
teacher_out,teacher_features = teacher_net(images)
for i in range(3):
ComputeFeatureLoss = FeatureLoss(features[i].shape[1],teacher_features[i].shape[1])
ComputeFeatureLoss = ComputeFeatureLoss.cuda()
distilloss=ComputeFeatureLoss(features[i],teacher_features[i],targets)
loss= loss + distilloss
retinaface的targets是归一化的值,不是像素值,所以我去掉了img_metas。FeatureLoss的参数采用的默认值,请问造成精度较低的原因可能有哪些?
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
When I run the test code, I meet this problem:
Traceback (most recent call last):
File "tools/train.py", line 199, in
main()
File "tools/train.py", line 172, in main
test_cfg=student_cfg.get('test_cfg'))
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/distillation/builder.py", line 47, in build_distiller
return build(cfg, DISTILLER, dict(teacher_cfg=teacher_cfg,student_cfg=student_cfg))
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/distillation/builder.py", line 29, in build
return build_from_cfg(cfg, registry, default_args)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmcv/utils/registry.py", line 171, in build_from_cfg
return obj_cls(**args)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/distillation/distillers/detection_distiller.py", line 30, in init
test_cfg=teacher_cfg.get('test_cfg'))
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/models/builder.py", line 77, in build_detector
return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/models/builder.py", line 34, in build
return build_from_cfg(cfg, registry, default_args)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmcv/utils/registry.py", line 171, in build_from_cfg
return obj_cls(**args)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/models/detectors/retinanet.py", line 17, in init
test_cfg, pretrained)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/models/detectors/single_stage.py", line 25, in init
self.backbone = build_backbone(backbone)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/models/builder.py", line 39, in build_backbone
return build(cfg, BACKBONES)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/models/builder.py", line 34, in build
return build_from_cfg(cfg, registry, default_args)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmcv/utils/registry.py", line 171, in build_from_cfg
return obj_cls(**args)
File "/root/miniconda3/envs/fgd/lib/python3.7/site-packages/mmdet/models/backbones/resnext.py", line 145, in init
super(ResNeXt, self).init(**kwargs)
TypeError: init() got an unexpected keyword argument 'init_cfg'
How can I fix it?
Hi, @yzd-v
How you draw figure 6 in the paper? can you give me some suggestions on it?
Do you draw this figure by mmdet's tool? Because this style figure has been appeared in previous papers too.
Thanks
your code of Get_FEA_loss calculation is that:
fea_t = torch.mul(preds_T, torch.sqrt(S_t))
fea_t = torch.mul(fea_t, torch.sqrt(C_t))
fea_s = torch.mul(preds_s, torch.sqrt(S_t))
fea_s = torch.mul(fea_s, torch.sqrt(C_t))
I think the Get_FEA_loss calculation's is that
fea_t = torch.mul(preds_T, torch.sqrt(S_t))
fea_t = torch.mul(fea_t, torch.sqrt(C_t))
fea_s = torch.mul(preds_s, torch.sqrt(S_s))
fea_s = torch.mul(fea_s, torch.sqrt(C_s))
this is just my guess, I hope you give me the answer
你好,我用retinaface训练自己的数据集,发现使用fgd后精度比不用低。teacher模型已验证精度,是正常的。我的teacher模型backbone是resnet50,student的backbone是mobilenetv3-small。
我将ssh后的特征层拿来计算fgd的loss,具体代码如下:
out,features = net(images)
loss_l, loss_c = criterion(out, priors, targets)
loss = cfg['loc_weight'] * loss_l + loss_c
with torch.no_grad():
teacher_out,teacher_features = teacher_net(images)
for i in range(3):
ComputeFeatureLoss = FeatureLoss(features[i].shape[1],teacher_features[i].shape[1])
ComputeFeatureLoss = ComputeFeatureLoss.cuda()
distilloss=ComputeFeatureLoss(features[i],teacher_features[i],targets)
loss= loss + distilloss
retinaface的targets是归一化的值,不是像素值,所以我去掉了img_metas。FeatureLoss的参数采用的默认值,请问造成精度较低的原因可能有哪些?
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?
請問這個bug該怎麼解呢
FileNotFoundError: file "D:\xxxxxx\yolococo\FGD\configs_base_\datasets\coco_detection.py" does not exist
作者,你好,我在训练FCOS代码时出现 预下载模型警告与模型设置不匹配
请问这些是由于什么引起的,该怎么解决。期待您的回复。
student_cfg = 'mmdetection/configs/fcos/fcos_center-normbbox-giou_r50_caffe_fpn_gn-head_mstrain_1x_coco.py'
teacher_cfg = 'mmdetection/configs/fcos/fcos_r101_caffe_fpn_gn-head_mstrain_640-800_2x_coco.py'
work_dir = './work_dirs/fgd_fcos_r101_distill_fcos_r50_2x_coco'
gpu_ids = range(0, 1)
2022-03-15 21:04:36,929 - mmdet - INFO - load model from: open-mmlab://detectron/resnet101_caffe
2022-03-15 21:04:38,281 - mmdet - WARNING - The model and loaded state dict do not match exactly
unexpected key in source state_dict: conv1.bias, layer1.0.conv1.bias, layer1.0.conv2.bias, layer1.0.conv3.bias, layer1.0.downsample.0.bias, layer1.1.conv1.bias, layer1.1.conv2.bias, layer1.1.conv3.bias, layer1.2.conv1.bias, layer1.2.conv2.bias, layer1.2.conv3.bias, layer2.0.conv1.bias, layer2.0.conv2.bias, layer2.0.conv3.bias, layer2.0.downsample.0.bias, layer2.1.conv1.bias, layer2.1.conv2.bias, layer2.1.conv3.bias, layer2.2.conv1.bias, layer2.2.conv2.bias, layer2.2.conv3.bias, layer2.3.conv1.bias, layer2.3.conv2.bias, layer2.3.conv3.bias, layer3.0.conv1.bias, layer3.0.conv2.bias, layer3.0.conv3.bias, layer3.0.downsample.0.bias, layer3.1.conv1.bias, layer3.1.conv2.bias, layer3.1.conv3.bias, layer3.2.conv1.bias, layer3.2.conv2.bias, layer3.2.conv3.bias, layer3.3.conv1.bias, layer3.3.conv2.bias, layer3.3.conv3.bias, layer3.4.conv1.bias, layer3.4.conv2.bias, layer3.4.conv3.bias, layer3.5.conv1.bias, layer3.5.conv2.bias, layer3.5.conv3.bias, layer3.6.conv1.bias, layer3.6.conv2.bias, layer3.6.conv3.bias, layer3.7.conv1.bias, layer3.7.conv2.bias, layer3.7.conv3.bias, layer3.8.conv1.bias, layer3.8.conv2.bias, layer3.8.conv3.bias, layer3.9.conv1.bias, layer3.9.conv2.bias, layer3.9.conv3.bias, layer3.10.conv1.bias, layer3.10.conv2.bias, layer3.10.conv3.bias, layer3.11.conv1.bias, layer3.11.conv2.bias, layer3.11.conv3.bias, layer3.12.conv1.bias, layer3.12.conv2.bias, layer3.12.conv3.bias, layer3.13.conv1.bias, layer3.13.conv2.bias, layer3.13.conv3.bias, layer3.14.conv1.bias, layer3.14.conv2.bias, layer3.14.conv3.bias, layer3.15.conv1.bias, layer3.15.conv2.bias, layer3.15.conv3.bias, layer3.16.conv1.bias, layer3.16.conv2.bias, layer3.16.conv3.bias, layer3.17.conv1.bias, layer3.17.conv2.bias, layer3.17.conv3.bias, layer3.18.conv1.bias, layer3.18.conv2.bias, layer3.18.conv3.bias, layer3.19.conv1.bias, layer3.19.conv2.bias, layer3.19.conv3.bias, layer3.20.conv1.bias, layer3.20.conv2.bias, layer3.20.conv3.bias, layer3.21.conv1.bias, layer3.21.conv2.bias, layer3.21.conv3.bias, layer3.22.conv1.bias, layer3.22.conv2.bias, layer3.22.conv3.bias, layer4.0.conv1.bias, layer4.0.conv2.bias, layer4.0.conv3.bias, layer4.0.downsample.0.bias, layer4.1.conv1.bias, layer4.1.conv2.bias, layer4.1.conv3.bias, layer4.2.conv1.bias, layer4.2.conv2.bias, layer4.2.conv3.bias
/root/anaconda3/envs/Ming_VFNet_KD/lib/python3.7/site-packages/mmcv/cnn/bricks/conv_module.py:107: UserWarning: ConvModule has norm and bias at the same time
warnings.warn('ConvModule has norm and bias at the same time')
2022-03-15 21:04:39,487 - mmdet - INFO - load model from: open-mmlab://detectron2/resnet50_caffe
2022-03-15 21:04:39,573 - mmdet - WARNING - The model and loaded state dict do not match exactly
unexpected key in source state_dict: conv1.bias
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, backbone.layer1.0.bn1.running_var, backbone.layer1.0.conv2.weight, backbone.layer1.0.bn2.weight, backbone.layer1.0.bn2.bias, backbone.layer1.0.bn2.running_mean, backbone.layer1.0.bn2.running_var, backbone.layer1.0.conv3.weight, backbone.layer1.0.bn3.weight, backbone.layer1.0.bn3.bias, backbone.layer1.0.bn3.running_mean, backbone.layer1.0.bn3.running_var, backbone.layer1.0.downsample.0.weight, backbone.layer1.0.downsample.1.weight, backbone.layer1.0.downsample.1.bias, backbone.layer1.0.downsample.1.running_mean, backbone.layer1.0.downsample.1.running_var, backbone.layer1.1.conv1.weight, backbone.layer1.1.bn1.weight, backbone.layer1.1.bn1.bias, backbone.layer1.1.bn1.running_mean, backbone.layer1.1.bn1.running_var, backbone.layer1.1.conv2.weight, backbone.layer1.1.bn2.weight, backbone.layer1.1.bn2.bias, backbone.layer1.1.bn2.running_mean, backbone.layer1.1.bn2.running_var, backbone.layer1.1.conv3.weight, backbone.layer1.1.bn3.weight, backbone.layer1.1.bn3.bias, backbone.layer1.1.bn3.running_mean, backbone.layer1.1.bn3.running_var, backbone.layer1.2.conv1.weight, backbone.layer1.2.bn1.weight, backbone.layer1.2.bn1.bias, backbone.layer1.2.bn1.running_mean, backbone.layer1.2.bn1.running_var, backbone.layer1.2.conv2.weight, backbone.layer1.2.bn2.weight, backbone.layer1.2.bn2.bias, backbone.layer1.2.bn2.running_mean, backbone.layer1.2.bn2.running_var, backbone.layer1.2.conv3.weight, backbone.layer1.2.bn3.weight, backbone.layer1.2.bn3.bias, backbone.layer1.2.bn3.running_mean, backbone.layer1.2.bn3.running_var, backbone.layer2.0.conv1.weight, backbone.layer2.0.bn1.weight, backbone.layer2.0.bn1.bias, backbone.layer2.0.bn1.running_mean, backbone.layer2.0.bn1.running_var, backbone.layer2.0.conv2.weight, backbone.layer2.0.bn2.weight, backbone.layer2.0.bn2.bias, backbone.layer2.0.bn2.running_mean, backbone.layer2.0.bn2.running_var, backbone.layer2.0.conv3.weight, backbone.layer2.0.bn3.weight, backbone.layer2.0.bn3.bias, backbone.layer2.0.bn3.running_mean, backbone.layer2.0.bn3.running_var, backbone.layer2.0.downsample.0.weight, backbone.layer2.0.downsample.1.weight, backbone.layer2.0.downsample.1.bias, backbone.layer2.0.downsample.1.running_mean, backbone.layer2.0.downsample.1.running_var, backbone.layer2.1.conv1.weight, backbone.layer2.1.bn1.weight, backbone.layer2.1.bn1.bias, backbone.layer2.1.bn1.running_mean, backbone.layer2.1.bn1.running_var, backbone.layer2.1.conv2.weight, backbone.layer2.1.bn2.weight, backbone.layer2.1.bn2.bias, backbone.layer2.1.bn2.running_mean, backbone.layer2.1.bn2.running_var, backbone.layer2.1.conv3.weight, backbone.layer2.1.bn3.weight, backbone.layer2.1.bn3.bias, backbone.layer2.1.bn3.running_mean, backbone.layer2.1.bn3.running_var, backbone.layer2.2.conv1.weight, backbone.layer2.2.bn1.weight, backbone.layer2.2.bn1.bias, backbone.layer2.2.bn1.running_mean, backbone.layer2.2.bn1.running_var, backbone.layer2.2.conv2.weight, backbone.layer2.2.bn2.weight, backbone.layer2.2.bn2.bias, backbone.layer2.2.bn2.running_mean, backbone.layer2.2.bn2.running_var, backbone.layer2.2.conv3.weight, backbone.layer2.2.bn3.weight, backbone.layer2.2.bn3.bias, backbone.layer2.2.bn3.running_mean, backbone.layer2.2.bn3.running_var, backbone.layer2.3.conv1.weight, backbone.layer2.3.bn1.weight, backbone.layer2.3.bn1.bias, backbone.layer2.3.bn1.running_mean, backbone.layer2.3.bn1.running_var, backbone.layer2.3.conv2.weight, backbone.layer2.3.bn2.weight, backbone.layer2.3.bn2.bias, backbone.layer2.3.bn2.running_mean, backbone.layer2.3.bn2.running_var, backbone.layer2.3.conv3.weight, backbone.layer2.3.bn3.weight, backbone.layer2.3.bn3.bias, backbone.layer2.3.bn3.running_mean, backbone.layer2.3.bn3.running_var, backbone.layer3.0.conv1.weight, backbone.layer3.0.bn1.weight, backbone.layer3.0.bn1.bias, backbone.layer3.0.bn1.running_mean, backbone.layer3.0.bn1.running_var, backbone.layer3.0.conv2.weight, backbone.layer3.0.bn2.weight, backbone.layer3.0.bn2.bias, backbone.layer3.0.bn2.running_mean, backbone.layer3.0.bn2.running_var, backbone.layer3.0.conv3.weight, backbone.layer3.0.bn3.weight, backbone.layer3.0.bn3.bias, backbone.layer3.0.bn3.running_mean, backbone.layer3.0.bn3.running_var, backbone.layer3.0.downsample.0.weight, backbone.layer3.0.downsample.1.weight, backbone.layer3.0.downsample.1.bias, backbone.layer3.0.downsample.1.running_mean, backbone.layer3.0.downsample.1.running_var, backbone.layer3.1.conv1.weight, backbone.layer3.1.bn1.weight, backbone.layer3.1.bn1.bias, backbone.layer3.1.bn1.running_mean, backbone.layer3.1.bn1.running_var, backbone.layer3.1.conv2.weight, backbone.layer3.1.bn2.weight, backbone.layer3.1.bn2.bias, backbone.layer3.1.bn2.running_mean, backbone.layer3.1.bn2.running_var, backbone.layer3.1.conv3.weight, backbone.layer3.1.bn3.weight, backbone.layer3.1.bn3.bias, backbone.layer3.1.bn3.running_mean, backbone.layer3.1.bn3.running_var, backbone.layer3.2.conv1.weight, backbone.layer3.2.bn1.weight, backbone.layer3.2.bn1.bias, backbone.layer3.2.bn1.running_mean, backbone.layer3.2.bn1.running_var, backbone.layer3.2.conv2.weight, backbone.layer3.2.bn2.weight, backbone.layer3.2.bn2.bias, backbone.layer3.2.bn2.running_mean, backbone.layer3.2.bn2.running_var, backbone.layer3.2.conv3.weight, backbone.layer3.2.bn3.weight, backbone.layer3.2.bn3.bias, backbone.layer3.2.bn3.running_mean, backbone.layer3.2.bn3.running_var, backbone.layer3.3.conv1.weight, backbone.layer3.3.bn1.weight, backbone.layer3.3.bn1.bias, backbone.layer3.3.bn1.running_mean, backbone.layer3.3.bn1.running_var, backbone.layer3.3.conv2.weight, backbone.layer3.3.bn2.weight, backbone.layer3.3.bn2.bias, backbone.layer3.3.bn2.running_mean, backbone.layer3.3.bn2.running_var, backbone.layer3.3.conv3.weight, backbone.layer3.3.bn3.weight, backbone.layer3.3.bn3.bias, backbone.layer3.3.bn3.running_mean, backbone.layer3.3.bn3.running_var, backbone.layer3.4.conv1.weight, backbone.layer3.4.bn1.weight, backbone.layer3.4.bn1.bias, backbone.layer3.4.bn1.running_mean, backbone.layer3.4.bn1.running_var, backbone.layer3.4.conv2.weight, backbone.layer3.4.bn2.weight, backbone.layer3.4.bn2.bias, backbone.layer3.4.bn2.running_mean, backbone.layer3.4.bn2.running_var, backbone.layer3.4.conv3.weight, backbone.layer3.4.bn3.weight, backbone.layer3.4.bn3.bias, backbone.layer3.4.bn3.running_mean, backbone.layer3.4.bn3.running_var, backbone.layer3.5.conv1.weight, backbone.layer3.5.bn1.weight, backbone.layer3.5.bn1.bias, backbone.layer3.5.bn1.running_mean, backbone.layer3.5.bn1.running_var, backbone.layer3.5.conv2.weight, backbone.layer3.5.bn2.weight, backbone.layer3.5.bn2.bias, backbone.layer3.5.bn2.running_mean, backbone.layer3.5.bn2.running_var, backbone.layer3.5.conv3.weight, backbone.layer3.5.bn3.weight, backbone.layer3.5.bn3.bias, backbone.layer3.5.bn3.running_mean, backbone.layer3.5.bn3.running_var, backbone.layer4.0.conv1.weight, backbone.layer4.0.bn1.weight, backbone.layer4.0.bn1.bias, backbone.layer4.0.bn1.running_mean, backbone.layer4.0.bn1.running_var, backbone.layer4.0.conv2.weight, backbone.layer4.0.bn2.weight, backbone.layer4.0.bn2.bias, backbone.layer4.0.bn2.running_mean, backbone.layer4.0.bn2.running_var, backbone.layer4.0.conv3.weight, backbone.layer4.0.bn3.weight, backbone.layer4.0.bn3.bias, backbone.layer4.0.bn3.running_mean, backbone.layer4.0.bn3.running_var, backbone.layer4.0.downsample.0.weight, backbone.layer4.0.downsample.1.weight, backbone.layer4.0.downsample.1.bias, backbone.layer4.0.downsample.1.running_mean, backbone.layer4.0.downsample.1.running_var, backbone.layer4.1.conv1.weight, backbone.layer4.1.bn1.weight, backbone.layer4.1.bn1.bias, backbone.layer4.1.bn1.running_mean, backbone.layer4.1.bn1.running_var, backbone.layer4.1.conv2.weight, backbone.layer4.1.bn2.weight, backbone.layer4.1.bn2.bias, backbone.layer4.1.bn2.running_mean, backbone.layer4.1.bn2.running_var, backbone.layer4.1.conv3.weight, backbone.layer4.1.bn3.weight, backbone.layer4.1.bn3.bias, backbone.layer4.1.bn3.running_mean, backbone.layer4.1.bn3.running_var, backbone.layer4.2.conv1.weight, backbone.layer4.2.bn1.weight, backbone.layer4.2.bn1.bias, backbone.layer4.2.bn1.running_mean, backbone.layer4.2.bn1.running_var, backbone.layer4.2.conv2.weight, backbone.layer4.2.bn2.weight, backbone.layer4.2.bn2.bias, backbone.layer4.2.bn2.running_mean, backbone.layer4.2.bn2.running_var, backbone.layer4.2.conv3.weight, backbone.layer4.2.bn3.weight, backbone.layer4.2.bn3.bias, backbone.layer4.2.bn3.running_mean, backbone.layer4.2.bn3.running_var, bbox_head.cls_convs.0.conv.bias, bbox_head.cls_convs.1.conv.bias, bbox_head.cls_convs.2.conv.bias, bbox_head.cls_convs.3.conv.bias, bbox_head.reg_convs.0.conv.bias, bbox_head.reg_convs.1.conv.bias, bbox_head.reg_convs.2.conv.bias, bbox_head.reg_convs.3.conv.bias
Hi,I try to run the code bug get this error: AttributeError: module 'torch' has no attribute 'maximum'.
I wonder why use 'last_zero_init' in last conv2d of channel_add_conv?
Weather the gradient will be zero?
Hi, I have run
fgd_faster_rcnn_r101_fpn_2x_distill_faster_rcnn_r50_fpn_2x_coco.py
for 24 epochs, using batch size == 4*8, I get mAP 0.405 for faster_rcnn_r50_fpn_2x_coco.
In your benchmark I found faster_rcnn_r50_fpn_2x_coco upto 0.420, I want to know your training config, teacher resnet 101 and student resnet 50?
請問關於論文中GcBlock是如何計算loss並且更新的呢?
The conclusion of this paper is fascinating,so i apply FGD to yolov5 on my dataset.
But, the performance dropped a lot, which makes me confused.
If I have a chance, would you please communicate with me. thank u for your replying
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 ?
Hi,thank you for wonderful job!
Is there any training log file?I want to know more details.It is very nice of you to share the log file.
How to modify FGD to run yolox-tiny with yolox-l as the teather? In FGD/configs/distillers/fgd, I can't find the config of yolox.
Thank you so much!
For feature value less than 0, why conduct abs on them rather than relu ?
我训练好了模型,如何像工具箱的基础模型一样展示出图像检测信息的可视化图?
Hi,
there are some of the loss weights, like https://github.com/yzd-v/FGD/blob/master/mmdet/distillation/losses/fgd.py#L27
How did you tune these loss weights? Any guideline to tune these hyper parameters?
wonderful job!
你好,请问是否方便分享你关于yolox蒸馏的训练log呢,我这里做实验发现loss很大
2022-04-08 17:58:08,668 - mmdet - INFO - Epoch [1][1250/118287] lr: 4.467e-08, eta: 167 days, 16:07:21, time: 0.428, data_time: 0.004, memory: 2774, loss_cls: 60.3157, loss_bbox: 4.9311, loss_obj: 789.3043, loss_fgd_fpn_0: 16.6030, loss_fgd_fpn_1: 8.2193, loss_fgd_fpn_2: 5.1861, loss: 884.5595
2022-04-08 17:58:30,345 - mmdet - INFO - Epoch [1][1300/118287] lr: 4.831e-08, eta: 168 days, 1:42:49, time: 0.434, data_time: 0.003, memory: 2774, loss_cls: 59.7414, loss_bbox: 4.9194, loss_obj: 658.8756, loss_fgd_fpn_0: 16.5385, loss_fgd_fpn_1: 8.5324, loss_fgd_fpn_2: 5.8226, loss: 754.4300
2022-04-08 17:58:50,696 - mmdet - INFO - Epoch [1][1350/118287] lr: 5.210e-08, eta: 168 days, 0:52:53, time: 0.407, data_time: 0.004, memory: 2774, loss_cls: 60.2803, loss_bbox: 4.9286, loss_obj: 607.9920, loss_fgd_fpn_0: 16.4608, loss_fgd_fpn_1: 8.8669, loss_fgd_fpn_2: 5.9082, loss: 704.4368
2022-04-08 17:59:10,825 - mmdet - INFO - Epoch [1][1400/118287] lr: 5.603e-08, eta: 167 days, 22:34:20, time: 0.403, data_time: 0.003, memory: 2774, loss_cls: 59.7365, loss_bbox: 4.9219, loss_obj: 661.1137, loss_fgd_fpn_0: 16.0103, loss_fgd_fpn_1: 7.9456, loss_fgd_fpn_2: 5.0338, loss: 754.7618
2022-04-08 17:59:30,933 - mmdet - INFO - Epoch [1][1450/118287] lr: 6.011e-08, eta: 167 days, 20:15:54, time: 0.402, data_time: 0.003, memory: 2774, loss_cls: 59.2557, loss_bbox: 4.9317, loss_obj: 541.0851, loss_fgd_fpn_0: 15.5496, loss_fgd_fpn_1: 8.0421, loss_fgd_fpn_2: 5.8575, loss: 634.7217
2022-04-08 17:59:50,018 - mmdet - INFO - Epoch [1][1500/118287] lr: 6.432e-08, eta: 167 days, 11:23:51, time: 0.382, data_time: 0.003, memory: 2774, loss_cls: 61.0022, loss_bbox: 4.9315, loss_obj: 835.3638, loss_fgd_fpn_0: 15.7123, loss_fgd_fpn_1: 7.7190, loss_fgd_fpn_2: 4.7273, loss: 929.4562
2022-04-08 18:00:09,628 - mmdet - INFO - Epoch [1][1550/118287] lr: 6.868e-08, eta: 167 days, 6:25:52, time: 0.392, data_time: 0.003, memory: 2774, loss_cls: 60.0157, loss_bbox: 4.9357, loss_obj: 495.5345, loss_fgd_fpn_0: 16.1082, loss_fgd_fpn_1: 8.4474, loss_fgd_fpn_2: 5.5591, loss: 590.6006
2022-04-08 18:00:29,741 - mmdet - INFO - Epoch [1][1600/118287] lr: 7.319e-08, eta: 167 days, 4:52:12, time: 0.402, data_time: 0.003, memory: 2775, loss_cls: 59.3850, loss_bbox: 4.9409, loss_obj: 614.6885, loss_fgd_fpn_0: 18.0012, loss_fgd_fpn_1: 9.5463, loss_fgd_fpn_2: 6.1757, loss: 712.7377
2022-04-08 18:00:50,533 - mmdet - INFO - Epoch [1][1650/118287] lr: 7.783e-08, eta: 167 days, 7:27:43, time: 0.416, data_time: 0.004, memory: 2775, loss_cls: 59.7953, loss_bbox: 4.9407, loss_obj: 383.2778, loss_fgd_fpn_0: 17.3462, loss_fgd_fpn_1: 9.3381, loss_fgd_fpn_2: 6.2047, loss: 480.9028
2022-04-08 18:01:11,023 - mmdet - INFO - Epoch [1][1700/118287] lr: 8.262e-08, eta: 167 days, 8:10:01, time: 0.410, data_time: 0.004, memory: 2775, loss_cls: 60.0407, loss_bbox: 4.9524, loss_obj: 512.7835, loss_fgd_fpn_0: 19.2264, loss_fgd_fpn_1: 10.2176, loss_fgd_fpn_2: 6.6033, loss: 613.8240
2022-04-08 18:01:31,771 - mmdet - INFO - Epoch [1][1750/118287] lr: 8.755e-08, eta: 167 days, 10:15:31, time: 0.415, data_time: 0.003, memory: 2775, loss_cls: 58.6303, loss_bbox: 4.9528, loss_obj: 333.3065, loss_fgd_fpn_0: 17.7528, loss_fgd_fpn_1: 10.7522, loss_fgd_fpn_2: 7.3261, loss: 432.7208
Thanks your great works! If neck part were implemented by DCN, how to do FGD? Thank you.
我尝试把蒸馏的模型转onnx,但是出现了很多问题,主要问题出现在蒸馏的那几层
请问您这边尝试过转onnx吗
Thank you for open this repo.
FGD/mmdet/distillation/losses/fgd.py
Line 152 in 7cdd34e
HI, about yolox, can you update the config? i am tring fgd in yolox-tiny, but for ap50, it only improved 0.1%, could you give some suggestions?
您好,拜读了您的论文,非常好的工作。请问论文里的figure1可视化的两张图是如何得到的呢
你好,非常感谢你的分享,我有一点不是很确定,最终的loss是由原检测器loss+每个fpn输出的特征层的FeatureLoss吗?比如fpn有三层,最终的loss是如下这样吗?
for i in stu_features:
distilloss=FeatureLoss(stu_features[i],tea_features[i],gt_bboxes,img_metas)
loss= loss + distilloss
你好,我想在你的代码再增加一个teacher,就是两个teacher,其中一个teacher有自己优化器,参数要更新,请问这种方式怎么修改?基于你的代码修改了一下,目前我采用的共用一个优化器,但是训练中没法测试,请问你的代码在训练时能够正常测试吗?还是先把权重转换成mmdet格式再测试?
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?
@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)
Hello, in the process of debugging the code, I encountered this problem: ModuleNotFoundError: No module named 'mmdet.distillation',I didn't find this module in mmdetection. Can you help me solve this problem?
Hi, @yzd-v
Sorry for disturbing you again, I have met some questions about meaning of some item in your config file.
For example, In retiannet config file: item student_module
,teacher_module
and output_hook
seem unused.
Do these items have any special meaning?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.