mmrazor icon indicating copy to clipboard operation
mmrazor copied to clipboard

Can this library be used in mm detection? How to use?

Open sunanlin13174 opened this issue 3 years ago • 9 comments

Checklist

  • I have searched related issues but cannot get the expected help.
  • I have read related documents and don't know what to do.

Describe the question you meet

[here]

Post related information

  1. The output of pip list | grep "mmcv\|mmrazor\|^torch" [here]
  2. Your config file if you modified it or created a new one.
[here]
  1. Your train log file if you meet the problem during training. [here]
  2. Other code you modified in the mmrazor folder. [here]

sunanlin13174 avatar May 18 '22 09:05 sunanlin13174

Hi, thank you for your attention. You can refer to DetNAS, which uses both SPOS from MMRazor and MMDet.

pprp avatar May 18 '22 09:05 pprp

@pprp 您好!我有两个问题: 1、只要mmdetection中有的模块mmrazor都能直接调用吗? 2、我在mmdetection中添加了其他的模块,这种情况怎么使用mmrazor中的蒸馏方法?

Please use English or English & Chinese for issues so that we could have broader discussion.

pppppM avatar May 18 '22 10:05 pppppM

OK! I have two questions. One is can mmrazor call directly all modules of mmdetection? The other is can I use distilling provided by mmrazor if I added other module in mmdetection? Appreciate it!

Audrey528 avatar May 18 '22 10:05 Audrey528

Thanks for your understanding. If your custom modules are registered into mmdet's registry, you can call it by adding mmdet prefix. https://github.com/open-mmlab/mmrazor/blob/2dad24044d7f1dad88f20221f8fc071dd40fdd4f/configs/nas/detnas/detnas_supernet_frcnn_shufflenetv2_fpn_1x_coco.py#L9

pppppM avatar May 18 '22 11:05 pppppM

Hi, @Audrey528, MMRazor currently can not be used in mmdet. On the contrary, you could implement mmdet in mmrazor.

In mmrazor, you should add mmdet prefix to get mmdet's registry.

norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
    type='mmdet.FasterRCNN',
    backbone=dict(
        type='mmcls.SearchableShuffleNetV2',
        norm_cfg=norm_cfg,
        out_indices=(0, 1, 2, 3),
        widen_factor=1.0,
        with_last_layer=False),

Maybe you can refer to CWD, an algorithm built based on mmseg.

In CWD, knowledge distillation is implemented in mmrazor. To complete the distillation-related training operations, you can migrate the mmdet part of the code to mmrazor.

pprp avatar May 18 '22 12:05 pprp

Hi, @pprp ,CWD is a good example, and it would be perfect if there was a general tutorial on how to implement mmdet and mmseg in MMRazor.

sunanlin13174 avatar May 19 '22 02:05 sunanlin13174

Hi, @sunanlin13174 , thank you for your advice! We will add this requirement to the backlog.

pprp avatar May 19 '22 03:05 pprp

@pprp @pppppM Thanks for your answers!Just like the following picture says, if I run 'pip install -v -e .', offical mmdet will be installed. I wanna know how can I install the mmdetection I changed modules. I need u help. 1652931394

Audrey528 avatar May 19 '22 03:05 Audrey528

@pprp @pppppM Thanks for your answers!Just like the following picture says, if I run 'pip install -v -e .', offical mmdet will be installed. I wanna know how can I install the mmdetection I changed modules. I need u help. 1652931394

There should be no re-installation of mmdet. If you have already installed a develop version mmdet, you can use your installed mmdet directly.

pppppM avatar May 19 '22 04:05 pppppM