code: def run_test(path, input):
      param_dict = dict(np.load(path))
      param_dict = {
          k.replace("/W", "/kernel").replace("/b", "/bias"): v
          for k, v in six.iteritems(param_dict)
      }
  
      predict_func = OfflinePredictor(
          PredictConfig(
              input_signature=[
                  tf.TensorSpec(
                      (None, 224, 224, 3), tf.float32, "input"
                  )
              ],
              tower_func=tower_func,
              session_init=SmartInit(param_dict),
              input_names=["input"],
              output_names=[
                  "prob"
              ],  # prob:0 is the probability distribution
          )
      )
  
      im = cv2.imread(input)
      assert im is not None, input
      im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB)
      im = (
          cv2.resize(im, (224, 224))
          .reshape((1, 224, 224, 3))
          .astype("float32")
      )
  
      # VGG16 requires channelwise mean substraction
      VGG_MEAN = [103.939, 116.779, 123.68]
      im -= VGG_MEAN[::-1]
  
      outputs = predict_func(im)[0]
      prob = outputs[0]
      ret = prob.argsort()[-10:][::-1]
      print("Top10 predictions:", ret)
  
      meta = ILSVRCMeta().get_synset_words_1000()
      print("Top10 class names:", [meta[k] for k in ret])
  
file_path: tensorpack/examples/CaffeModels/load-vgg16.py
imports: from __future__ import print_function
  import argparse
  import numpy
  import os
  import cv2
  import six
  import tensorflow
  from tensorpack import *
  from tensorpack.dataflow.dataset import ILSVRCMeta
label_desc: Use image node_id 2 for calling a global function with example usage: run_test(path, input) without return types