code: def ResNet50(
      pretrained=False, end_with="fc1000", n_classes=1000, name=None
  ):
      """Pre-trained MobileNetV1 model (static mode). Input shape [?, 224, 224, 3].
      To use pretrained model, input should be in BGR format and subtracted from ImageNet mean [103.939, 116.779, 123.68].
  
      Parameters
      ----------
      pretrained : boolean
          Whether to load pretrained weights. Default False.
      end_with : str
          The end point of the model [conv, depth1, depth2 ... depth13, globalmeanpool, out].
          Default ``out`` i.e. the whole model.
      n_classes : int
          Number of classes in final prediction.
      name : None or str
          Name for this model.
  
      Examples
      ---------
      Classify ImageNet classes, see `tutorial_models_resnet50.py`
  
      >>> # get the whole model with pretrained weights
      >>> resnet = tl.models.ResNet50(pretrained=True)
      >>> # use for inferencing
      >>> output = resnet(img1, is_train=False)
      >>> prob = tf.nn.softmax(output)[0].numpy()
  
      Extract the features before fc layer
      >>> resnet = tl.models.ResNet50(pretrained=True, end_with='5c')
      >>> output = resnet(img1, is_train=False)
  
      Returns
      -------
          ResNet50 model.
  
      """
      ni = Input([None, 224, 224, 3], name="input")
      n = Conv2d(
          64,
          (7, 7),
          strides=(2, 2),
          padding="SAME",
          W_init=tf.initializers.he_normal(),
          name="conv1",
      )(ni)
      n = BatchNorm(name="bn_conv1", act="relu")(n)
      n = MaxPool2d((3, 3), strides=(2, 2), name="max_pool1")(n)
  
      for i, block_name in enumerate(block_names):
          if len(block_name) == 2:
              stage = int(block_name[0])
              block = block_name[1]
              if block == "a":
                  strides = (1, 1) if stage == 2 else (2, 2)
                  n = conv_block(
                      n,
                      3,
                      block_filters[stage - 2],
                      stage=stage,
                      block=block,
                      strides=strides,
                  )
              else:
                  n = identity_block(
                      n,
                      3,
                      block_filters[stage - 2],
                      stage=stage,
                      block=block,
                  )
          elif block_name == "avg_pool":
              n = GlobalMeanPool2d(name="avg_pool")(n)
          elif block_name == "fc1000":
              n = Dense(n_classes, name="fc1000")(n)
  
          if block_name == end_with:
              break
  
      network = Model(inputs=ni, outputs=n, name=name)
  
      if pretrained:
          restore_params(network)
  
      return network
  
file_path: TensorLayer/tensorlayer/models/resnet.py
imports: import os
  import tensorflow
  from tensorlayer import logging
  from tensorlayer.files import assign_weights, load_npz, maybe_download_and_extract
  from tensorlayer.layers import BatchNorm, Conv2d, Dense, Elementwise, GlobalMeanPool2d, Input, MaxPool2d
  from tensorlayer.models import Model
label_desc: Use image node_id 3 for calling a global function with example usage: ResNet50(pretrained, end_with, n_classes, name) and returns: network