class_docstr: MobileNetV2
code: def __init__(
      self, class_dim: int = 1000, load_checkpoint: str = None
  ):
      super(MobileNet, self).__init__()
  
      self.class_dim = class_dim
  
      bottleneck_params_list = [
          (1, 16, 1, 1),
          (6, 24, 2, 2),
          (6, 32, 3, 2),
          (6, 64, 4, 2),
          (6, 96, 3, 1),
          (6, 160, 3, 2),
          (6, 320, 1, 1),
      ]
  
      self.conv1 = ConvBNLayer(
          num_channels=3,
          num_filters=int(32),
          filter_size=3,
          stride=2,
          padding=1,
          name="conv1_1",
      )
  
      self.block_list = []
      i = 1
      in_c = int(32)
      for layer_setting in bottleneck_params_list:
          t, c, n, s = layer_setting
          i += 1
          block = self.add_sublayer(
              "conv" + str(i),
              sublayer=InversiBlocks(
                  in_c=in_c,
                  t=t,
                  c=int(c),
                  n=n,
                  s=s,
                  name="conv" + str(i),
              ),
          )
          self.block_list.append(block)
          in_c = int(c)
  
      self.out_c = 1280
      self.conv9 = ConvBNLayer(
          num_channels=in_c,
          num_filters=self.out_c,
          filter_size=1,
          stride=1,
          padding=0,
          name="conv9",
      )
  
      self.pool2d_avg = AdaptiveAvgPool2d(1)
  
      self.out = Linear(
          self.out_c,
          class_dim,
          weight_attr=ParamAttr(name="fc10_weights"),
          bias_attr=ParamAttr(name="fc10_offset"),
      )
  
      if load_checkpoint is not None:
          model_dict = paddle.load(load_checkpoint)[0]
          self.set_dict(model_dict)
          print("load custom checkpoint success")
  
      else:
          checkpoint = os.path.join(
              self.directory, "mobilenet_v2_imagenet.pdparams"
          )
          if not os.path.exists(checkpoint):
              os.system(
                  "wget https://paddlehub.bj.bcebos.com/dygraph/image_classification/mobilenet_v2_imagenet.pdparams -O "
                  + checkpoint
              )
          model_dict = paddle.load(checkpoint)[0]
          self.set_dict(model_dict)
          print("load pretrained checkpoint success")
  
imports: import os
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn import Conv2d, BatchNorm, Linear, Dropout
  from paddle.nn import AdaptiveAvgPool2d, MaxPool2d, AvgPool2d
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.cv_module import ImageClassifierModule
label_desc: Use image node_id 1 to create a new MobileNet object from inherited base classes: nn with example: obj = MobileNet(class_dim, load_checkpoint)