class_docstr: MobileNetV3 backbone.
  
  This backbone is the improved implementation of `Searching for MobileNetV3
  <https://ieeexplore.ieee.org/document/9008835>`_.
  
  Args:
      arch (str): Architecture of mobilnetv3, from {'small', 'large'}.
          Default: 'small'.
      conv_cfg (dict): Config dict for convolution layer.
          Default: None, which means using conv2d.
      norm_cfg (dict): Config dict for normalization layer.
          Default: dict(type='BN').
      out_indices (tuple[int]): Output from which layer.
          Default: (0, 1, 12).
      frozen_stages (int): Stages to be frozen (all param fixed).
          Default: -1, which means not freezing any parameters.
      norm_eval (bool): Whether to set norm layers to eval mode, namely,
          freeze running stats (mean and var). Note: Effect on Batch Norm
          and its variants only. Default: False.
      with_cp (bool): Use checkpoint or not. Using checkpoint will save
          some memory while slowing down the training speed.
          Default: False.
class_docstr_tok: ["MobileNetV3","backbone",".","This","backbone","is","the","improved","implementation","of","`","Searching","for","MobileNetV3","<","https",":","\/\/ieeexplore.ieee.org\/document\/9008835",">","`","_",".","Args",":","arch","(","str",")",":","Architecture","of","mobilnetv3",",","from","{","'small","'",",","'large","'","}",".","Default",":","'small","'",".","conv_cfg","(","dict",")",":","Config","dict","for","convolution","layer",".","Default",":","None",",","which","means","using","conv2d",".","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Default",":","dict","(","type='BN","'",")",".","out_indices","(","tuple","[","int","]",")",":","Output","from","which","layer",".","Default",":","(","0",",","1",",","12",")",".","frozen_stages","(","int",")",":","Stages","to","be","frozen","(","all","param","fixed",")",".","Default",":","-1",",","which","means","not","freezing","any","parameters",".","norm_eval","(","bool",")",":","Whether","to","set","norm","layers","to","eval","mode",",","namely",",","freeze","running","stats","(","mean","and","var",")",".","Note",":","Effect","on","Batch","Norm","and","its","variants","only",".","Default",":","False",".","with_cp","(","bool",")",":","Use","checkpoint","or","not",".","Using","checkpoint","will","save","some","memory","while","slowing","down","the","training","speed",".","Default",":","False","."]
code: def init_weights(self, pretrained=None):
      if isinstance(pretrained, str):
          logger = logging.getLogger()
          load_checkpoint(self, pretrained, strict=False, logger=logger)
      elif pretrained is None:
          for m in self.modules():
              if isinstance(m, nn.Conv2d):
                  kaiming_init(m)
              elif isinstance(m, nn.BatchNorm2d):
                  constant_init(m, 1)
      else:
          raise TypeError("pretrained must be a str or None")
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/backbones/mobilenet_v3.py
imports: import logging
  import annotator.uniformer.mmcv
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule, constant_init, kaiming_init
  from annotator.uniformer.mmcv.cnn.bricks import Conv2dAdaptivePadding
  from annotator.uniformer.mmcv.runner import load_checkpoint
  from torch.nn.modules.batchnorm import _BatchNorm
  from ..builder import BACKBONES
  from ..utils import InvertedResidualV3
label_desc: Use image node_id 3 for calling the MobileNetV3 obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types