class_docstr: ResNet50_vd model.
class_docstr_tok: ["ResNet50_vd","model","."]
code: def __init__(
      self, class_dim: int = 1000, load_checkpoint: str = None
  ):
      super(ResNet50_vd, self).__init__()
  
      self.layers = 50
      depth = [3, 4, 6, 3]
      num_channels = [64, 256, 512, 1024]
      num_filters = [64, 128, 256, 512]
  
      self.conv1_1 = ConvBNLayer(
          num_channels=3,
          num_filters=32,
          filter_size=3,
          stride=2,
          act="relu",
          name="conv1_1",
      )
      self.conv1_2 = ConvBNLayer(
          num_channels=32,
          num_filters=32,
          filter_size=3,
          stride=1,
          act="relu",
          name="conv1_2",
      )
      self.conv1_3 = ConvBNLayer(
          num_channels=32,
          num_filters=64,
          filter_size=3,
          stride=1,
          act="relu",
          name="conv1_3",
      )
      self.pool2d_max = MaxPool2d(kernel_size=3, stride=2, padding=1)
  
      self.block_list = []
  
      for block in range(len(depth)):
          shortcut = False
          for i in range(depth[block]):
              conv_name = "res" + str(block + 2) + chr(97 + i)
              bottleneck_block = self.add_sublayer(
                  "bb_%d_%d" % (block, i),
                  BottleneckBlock(
                      num_channels=num_channels[block]
                      if i == 0
                      else num_filters[block] * 4,
                      num_filters=num_filters[block],
                      stride=2 if i == 0 and block != 0 else 1,
                      shortcut=shortcut,
                      if_first=block == i == 0,
                      name=conv_name,
                  ),
              )
              self.block_list.append(bottleneck_block)
              shortcut = True
  
      self.pool2d_avg = AdaptiveAvgPool2d(1)
      self.pool2d_avg_channels = num_channels[-1] * 2
      stdv = 1.0 / math.sqrt(self.pool2d_avg_channels * 1.0)
  
      self.out = Linear(
          self.pool2d_avg_channels,
          class_dim,
          weight_attr=ParamAttr(
              initializer=Uniform(-stdv, stdv), name="fc_0.w_0"
          ),
          bias_attr=ParamAttr(name="fc_0.b_0"),
      )
  
      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, "resnet50_vd_10w.pdparams"
          )
          if not os.path.exists(checkpoint):
              os.system(
                  "wget https://paddlehub.bj.bcebos.com/dygraph/image_classification/resnet50_vd_10w.pdparams -O "
                  + checkpoint
              )
          model_dict = paddle.load(checkpoint)[0]
          self.set_dict(model_dict)
          print("load pretrained checkpoint success")
  
imports: import os
  import math
  import numpy
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  from paddle.nn import Conv2d, BatchNorm, Linear, Dropout
  from paddle.nn import AdaptiveAvgPool2d, MaxPool2d, AvgPool2d
  from paddle.nn.initializer import Uniform
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.cv_module import ImageClassifierModule
label_desc: Use image node_id 1 to create a new ResNet50_vd object from inherited base classes: nn with example: obj = ResNet50_vd(class_dim, load_checkpoint)