code: def _resnet(
      block,
      blocks_num,
      im_width=224,
      im_height=224,
      num_classes=1000,
      include_top=True,
  ):
      # tensorflow中的tensor通道排序是NHWC
      # (None, 224, 224, 3)
      input_image = layers.Input(
          shape=(im_height, im_width, 3), dtype="float32"
      )
      x = layers.Conv2D(
          filters=64,
          kernel_size=7,
          strides=2,
          padding="SAME",
          use_bias=False,
          name="conv1",
      )(input_image)
      x = layers.BatchNormalization(
          momentum=0.9, epsilon=1e-5, name="conv1/BatchNorm"
      )(x)
      x = layers.ReLU()(x)
      x = layers.MaxPool2D(pool_size=3, strides=2, padding="SAME")(x)
  
      x = _make_layer(
          block, x.shape[-1], 64, blocks_num[0], name="block1"
      )(x)
      x = _make_layer(
          block,
          x.shape[-1],
          128,
          blocks_num[1],
          strides=2,
          name="block2",
      )(x)
      x = _make_layer(
          block,
          x.shape[-1],
          256,
          blocks_num[2],
          strides=2,
          name="block3",
      )(x)
      x = _make_layer(
          block,
          x.shape[-1],
          512,
          blocks_num[3],
          strides=2,
          name="block4",
      )(x)
  
      if include_top:
          x = layers.GlobalAvgPool2D()(x)  # pool + flatten
          x = layers.Dense(num_classes, name="logits")(x)
          predict = layers.Softmax()(x)
      else:
          predict = x
  
      model = Model(inputs=input_image, outputs=predict)
  
      return model
  
file_path: deep-learning-for-image-processing/tensorflow_classification/Test5_resnet/model.py
imports: from tensorflow.keras import layers, Model, Sequential
label_desc: Use image node_id 2 for calling a global function with example usage: _resnet(block, blocks_num, im_width, im_height, num_classes, include_top) and returns: model