code: def GoogLeNet(
      im_height=224, im_width=224, class_num=1000, aux_logits=False
  ):
      # tensorflow中的tensor通道排序是NHWC
      input_image = layers.Input(
          shape=(im_height, im_width, 3), dtype="float32"
      )
      # (None, 224, 224, 3)
      x = layers.Conv2D(
          64,
          kernel_size=7,
          strides=2,
          padding="SAME",
          activation="relu",
          name="conv2d_1",
      )(input_image)
      # (None, 112, 112, 64)
      x = layers.MaxPool2D(
          pool_size=3, strides=2, padding="SAME", name="maxpool_1"
      )(x)
      # (None, 56, 56, 64)
      x = layers.Conv2D(
          64, kernel_size=1, activation="relu", name="conv2d_2"
      )(x)
      # (None, 56, 56, 64)
      x = layers.Conv2D(
          192,
          kernel_size=3,
          padding="SAME",
          activation="relu",
          name="conv2d_3",
      )(x)
      # (None, 56, 56, 192)
      x = layers.MaxPool2D(
          pool_size=3, strides=2, padding="SAME", name="maxpool_2"
      )(x)
  
      # (None, 28, 28, 192)
      x = Inception(64, 96, 128, 16, 32, 32, name="inception_3a")(x)
      # (None, 28, 28, 256)
      x = Inception(128, 128, 192, 32, 96, 64, name="inception_3b")(x)
  
      # (None, 28, 28, 480)
      x = layers.MaxPool2D(
          pool_size=3, strides=2, padding="SAME", name="maxpool_3"
      )(x)
      # (None, 14, 14, 480)
      x = Inception(192, 96, 208, 16, 48, 64, name="inception_4a")(x)
      if aux_logits:
          aux1 = InceptionAux(class_num, name="aux_1")(x)
  
      # (None, 14, 14, 512)
      x = Inception(160, 112, 224, 24, 64, 64, name="inception_4b")(x)
      # (None, 14, 14, 512)
      x = Inception(128, 128, 256, 24, 64, 64, name="inception_4c")(x)
      # (None, 14, 14, 512)
      x = Inception(112, 144, 288, 32, 64, 64, name="inception_4d")(x)
      if aux_logits:
          aux2 = InceptionAux(class_num, name="aux_2")(x)
  
      # (None, 14, 14, 528)
      x = Inception(256, 160, 320, 32, 128, 128, name="inception_4e")(x)
      # (None, 14, 14, 532)
      x = layers.MaxPool2D(
          pool_size=3, strides=2, padding="SAME", name="maxpool_4"
      )(x)
  
      # (None, 7, 7, 832)
      x = Inception(256, 160, 320, 32, 128, 128, name="inception_5a")(x)
      # (None, 7, 7, 832)
      x = Inception(384, 192, 384, 48, 128, 128, name="inception_5b")(x)
      # (None, 7, 7, 1024)
      x = layers.AvgPool2D(pool_size=7, strides=1, name="avgpool_1")(x)
  
      # (None, 1, 1, 1024)
      x = layers.Flatten(name="output_flatten")(x)
      # (None, 1024)
      x = layers.Dropout(rate=0.4, name="output_dropout")(x)
      x = layers.Dense(class_num, name="output_dense")(x)
      # (None, class_num)
      aux3 = layers.Softmax(name="aux_3")(x)
  
      if aux_logits:
          model = models.Model(
              inputs=input_image, outputs=[aux1, aux2, aux3]
          )
      else:
          model = models.Model(inputs=input_image, outputs=aux3)
      return model
  
file_path: deep-learning-for-image-processing/tensorflow_classification/Test4_goolenet/model.py
imports: from tensorflow.keras import layers, models, Model, Sequential
label_desc: Use image node_id 1 for calling a global function with example usage: GoogLeNet(im_height, im_width, class_num, aux_logits) and returns: model