MMdetection解读系列之backbone-resnet

科普知识

ResNet

Resnet
mmdetection中实现此结构

   arch_settings = {
        18: (BasicBlock, (2, 2, 2, 2)),
        34: (BasicBlock, (3, 4, 6, 3)),
        50: (Bottleneck, (3, 4, 6, 3)),
        101: (Bottleneck, (3, 4, 23, 3)),
        152: (Bottleneck, (3, 8, 36, 3))
    }
    # 注意BasicBlock Bottleneck均为一个类

RestNet 18/34采用BasicBlock作为基本单元,而ResNet 50/101/152采用Bottlenet Block作为基本单元
Block
Basic Block就是左边的图,包括两个3×3的卷积操作。bollteneck是右边的图,为了减少参数,它采用了两个1×1的卷积。

参数解读

""ResNet backbone.

    Args:
        depth (int): Depth of resnet, from {18, 34, 50, 101, 152}. ResNet深度,总所周知,常用的为50,101
        stem_channels (int | None): Number of stem channels. If not specified,
            it will be the same as `base_channels`. Default: None.
        base_channels (int): Number of base channels of res layer. Default: 64. 众所周知,这个为64详情见Resnet Conv1
        in_channels (int): Number of input image channels. Default: 3.众所周知
        num_stages (int): Resnet stages. Default: 4.众所周知 详情见conv1_x conv2_x .......称为一个stage
        strides (Sequence[int]): Strides of the first block of each stage.众所周知  每个stage第一个block的步长
        dilations (Sequence[int]): Dilation of each stage.众所周知,用于空洞卷积
        out_indices (Sequence[int]): Output from which stages. 众所周知,每个stage的输出
        style (str): `pytorch` or `caffe`. If set to "pytorch", the stride-two ##使用的是pytorch/caffe关系到使用3*3/1*1的卷积
            layer is the 3x3 conv layer, otherwise the stride-two layer is ##在步长为2时
            the first 1x1 conv layer.
        deep_stem (bool): Replace 7x7 conv in input stem with 3 3x3 conv ##在初始的时候即conv1使用3*3的卷积替代7*7的卷积
        avg_down (bool): Use AvgPool instead of stride conv when
            downsampling in the bottleneck.## 使用平均池化替代卷积下采样 H=ceil((H-F+2*P)/S+1)
        frozen_stages (int): Stages to be frozen (stop grad and set eval mode).
            -1 means not freezing any parameters. ##从stage4开始冻结几个stage拒绝梯度传播更新参数
        norm_cfg (dict): Dictionary to construct and config norm layer.## 正则化方式
        norm_eval (bool): Whether to set norm layers to eval mode, namely,## 用于测试模型时,将正则化设置为false,
            freeze running stats (mean and var). Note: Effect on Batch Norm
            and its variants only.
        plugins (list[dict]): List of plugins for stages, each dict contains: ##扩展模块

            - cfg (dict, required): Cfg dict to build plugin.## 需要扩展哪些操作,比如说dfn
            - position (str, re
  • 2
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值