code: def __init__(
      self, label_list: list = None, load_checkpoint: str = None
  ):
      super(HRNet30, self).__init__()
  
      if label_list is not None:
          self.labels = label_list
          class_dim = len(self.labels)
      else:
          label_list = []
          label_file = os.path.join(self.directory, "label_list.txt")
          files = open(label_file)
          for line in files.readlines():
              line = line.strip("\n")
              label_list.append(line)
          self.labels = label_list
          class_dim = len(self.labels)
  
      self.width = 30
      self.has_se = False
      self.channels = {
          18: [[18, 36], [18, 36, 72], [18, 36, 72, 144]],
          30: [[30, 60], [30, 60, 120], [30, 60, 120, 240]],
          32: [[32, 64], [32, 64, 128], [32, 64, 128, 256]],
          40: [[40, 80], [40, 80, 160], [40, 80, 160, 320]],
          44: [[44, 88], [44, 88, 176], [44, 88, 176, 352]],
          48: [[48, 96], [48, 96, 192], [48, 96, 192, 384]],
          60: [[60, 120], [60, 120, 240], [60, 120, 240, 480]],
          64: [[64, 128], [64, 128, 256], [64, 128, 256, 512]],
      }
      self._class_dim = class_dim
  
      channels_2, channels_3, channels_4 = self.channels[self.width]
      num_modules_2, num_modules_3, num_modules_4 = 1, 4, 3
  
      self.conv_layer1_1 = ConvBNLayer(
          num_channels=3,
          num_filters=64,
          filter_size=3,
          stride=2,
          act="relu",
          name="layer1_1",
      )
  
      self.conv_layer1_2 = ConvBNLayer(
          num_channels=64,
          num_filters=64,
          filter_size=3,
          stride=2,
          act="relu",
          name="layer1_2",
      )
  
      self.la1 = Layer1(
          num_channels=64, has_se=self.has_se, name="layer2"
      )
  
      self.tr1 = TransitionLayer(
          in_channels=[256], out_channels=channels_2, name="tr1"
      )
  
      self.st2 = Stage(
          num_channels=channels_2,
          num_modules=num_modules_2,
          num_filters=channels_2,
          has_se=self.has_se,
          name="st2",
      )
  
      self.tr2 = TransitionLayer(
          in_channels=channels_2, out_channels=channels_3, name="tr2"
      )
      self.st3 = Stage(
          num_channels=channels_3,
          num_modules=num_modules_3,
          num_filters=channels_3,
          has_se=self.has_se,
          name="st3",
      )
  
      self.tr3 = TransitionLayer(
          in_channels=channels_3, out_channels=channels_4, name="tr3"
      )
      self.st4 = Stage(
          num_channels=channels_4,
          num_modules=num_modules_4,
          num_filters=channels_4,
          has_se=self.has_se,
          name="st4",
      )
  
      # classification
      num_filters_list = [32, 64, 128, 256]
      self.last_cls = LastClsOut(
          num_channel_list=channels_4,
          has_se=self.has_se,
          num_filters_list=num_filters_list,
          name="cls_head",
      )
  
      last_num_filters = [256, 512, 1024]
      self.cls_head_conv_list = []
      for idx in range(3):
          self.cls_head_conv_list.append(
              self.add_sublayer(
                  "cls_head_add{}".format(idx + 1),
                  ConvBNLayer(
                      num_channels=num_filters_list[idx] * 4,
                      num_filters=last_num_filters[idx],
                      filter_size=3,
                      stride=2,
                      name="cls_head_add" + str(idx + 1),
                  ),
              )
          )
  
      self.conv_last = ConvBNLayer(
          num_channels=1024,
          num_filters=2048,
          filter_size=1,
          stride=1,
          name="cls_head_last_conv",
      )
  
      self.pool2d_avg = nn.AdaptiveAvgPool2D(1)
  
      stdv = 1.0 / math.sqrt(2048 * 1.0)
  
      self.out = nn.Linear(
          2048,
          class_dim,
          weight_attr=ParamAttr(
              initializer=Uniform(-stdv, stdv), name="fc_weights"
          ),
          bias_attr=ParamAttr(name="fc_offset"),
      )
  
      if load_checkpoint is not None:
          self.model_dict = paddle.load(load_checkpoint)
          self.set_dict(self.model_dict)
          print("load custom checkpoint success")
      else:
          checkpoint = os.path.join(self.directory, "model.pdparams")
          self.model_dict = paddle.load(checkpoint)
          self.set_dict(self.model_dict)
          print("load pretrained checkpoint success")
  
imports: import os
  import math
  from typing import Union
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import paddlehub.vision.transforms
  import numpy
  from paddle.nn.initializer import Uniform
  from paddle import ParamAttr
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.cv_module import ImageClassifierModule
label_desc: Use image node_id 1 to create a new HRNet30 object from inherited base classes: nn with example: obj = HRNet30(label_list, load_checkpoint)