Syencil / mobile-yolov5-pruning-distillation

mobilev2-yolov5s剪枝、蒸馏,支持ncnn,tensorRT部署。ultra-light but better performence!
MIT License
821 stars 163 forks source link

蒸馏代码问题 #80

Open ftl123456789 opened 1 year ago

ftl123456789 commented 1 year ago

hooks.append(model.model._modules["6"].register_forward_hook(get_activation("s_f1"))) hooks.append(model.model._modules["13"].register_forward_hook(get_activation("s_f2"))) hooks.append(model.model._modules["17"].register_forward_hook(get_activation("s_f3")))

T-model

            hooks.append(t_model.model._modules["4"].register_forward_hook(get_activation("t_f1")))
            hooks.append(t_model.model._modules["6"].register_forward_hook(get_activation("t_f2")))
            hooks.append(t_model.model._modules["10"].register_forward_hook(get_activation("t_f3")))
            return hooks
        # feature convert
        from models.common import Converter
        c1 = 128
        c2 = 256
        c3 = 512
        if opt.type == "dfmvocs_l":
            c1 = 256
            c2 = 512
            c3 = 1024

为什么选择6,13,17 和4,6等这些层作为提取,还有c1,c2,c3的选择有什么技巧吗》为什么选择这些数