code: def build_graph(self, image, label):
      blocks = CFG[DEPTH]
  
      bottleneck = functools.partial(
          resnet_bottleneck, stride_first=True
      )
  
      # tensorflow with padding=SAME will by default pad [2,3] here.
      # but caffe conv with stride will pad [3,2]
      image = tf.pad(image, [[0, 0], [3, 2], [3, 2], [0, 0]])
      image = tf.transpose(image, [0, 3, 1, 2])
      with argscope(
          [Conv2D, MaxPooling, GlobalAvgPooling, BatchNorm],
          data_format="channels_first",
      ), argscope(Conv2D, use_bias=False):
          logits = (
              LinearWrap(image)
              .Conv2D(
                  "conv0",
                  64,
                  7,
                  strides=2,
                  activation=BNReLU,
                  padding="VALID",
              )
              .MaxPooling("pool0", 3, strides=2, padding="SAME")
              .apply2(
                  resnet_group, "group0", bottleneck, 64, blocks[0], 1
              )
              .apply2(
                  resnet_group, "group1", bottleneck, 128, blocks[1], 2
              )
              .apply2(
                  resnet_group, "group2", bottleneck, 256, blocks[2], 2
              )
              .apply2(
                  resnet_group, "group3", bottleneck, 512, blocks[3], 2
              )
              .GlobalAvgPooling("gap")
              .FullyConnected("linear", 1000)()
          )
      tf.nn.softmax(logits, name="prob")
      ImageNetModel.compute_loss_and_error(logits, label)
  
file_path: tensorpack/examples/ResNet/load-resnet.py
imports: import argparse
  import functools
  import numpy
  import re
  import cv2
  import six
  import tensorflow
  from tensorpack import *
  from tensorpack.dataflow.dataset import ILSVRCMeta
  from tensorpack.utils import logger
  from imagenet_utils import ImageNetModel, eval_classification, get_imagenet_dataflow
  from resnet_model import resnet_bottleneck, resnet_group
label_desc: Use image node_id 2 for calling the Model obj's underlying member method code with example usage: obj.build_graph(image, label) without return types