code: def get_config():
      nr_tower = max(get_num_gpu(), 1)
      batch = args.batch
      total_batch = batch * nr_tower
      assert (
          total_batch >= 256
      )  # otherwise the learning rate warmup is wrong.
      BASE_LR = 0.01 * (total_batch / 256.0)
  
      logger.info(
          "Running on {} towers. Batch size per tower: {}".format(
              nr_tower, batch
          )
      )
      dataset_train = get_data("train", batch)
      dataset_val = get_data("val", batch)
  
      infs = [
          ClassificationError("wrong-top1", "val-error-top1"),
          ClassificationError("wrong-top5", "val-error-top5"),
      ]
      callbacks = [
          ModelSaver(),
          GPUUtilizationTracker(),
          EstimatedTimeLeft(),
          ScheduledHyperParamSetter(
              "learning_rate",
              [(0, 0.01), (3, max(BASE_LR, 0.01))],
              interp="linear",
          ),
          ScheduledHyperParamSetter(
              "learning_rate",
              [
                  (30, BASE_LR * 1e-1),
                  (60, BASE_LR * 1e-2),
                  (80, BASE_LR * 1e-3),
              ],
          ),
          DataParallelInferenceRunner(
              dataset_val, infs, list(range(nr_tower))
          ),
      ]
  
      input = QueueInput(dataset_train)
      input = StagingInput(input, nr_stage=1)
      return TrainConfig(
          model=Model(),
          data=input,
          callbacks=callbacks,
          steps_per_epoch=1281167 // total_batch,
          max_epoch=100,
      )
  
file_path: tensorpack/examples/ImageNetModels/vgg16.py
imports: import argparse
  import os
  from tensorpack import tfv1
  from tensorpack import *
  from tensorpack.tfutils import argscope
  from tensorpack.tfutils.summary import *
  from tensorpack.utils.gpu import get_num_gpu
  from imagenet_utils import ImageNetModel, fbresnet_augmentor, get_imagenet_dataflow
label_desc: Use image node_id 4 for calling a global function with example usage: get_config() and returns: TrainConfig