code: def inference(cls, architecture, files, path, image_path):
      import mxnet as mx
      import numpy as np
  
      if cls.sanity_check(architecture):
          file_name = cls.architecture_map[architecture][
              "params"
          ].split("/")[-1]
          prefix, epoch_num = file_name[:-7].rsplit("-", 1)
  
          sym, arg_params, aux_params = mx.model.load_checkpoint(
              path + prefix, int(epoch_num)
          )
          model = mx.mod.Module(symbol=sym)
          model.bind(
              for_training=False,
              data_shapes=[
                  ("data", (1, 3, cls._image_size, cls._image_size))
              ],
          )
          model.set_params(
              arg_params,
              aux_params,
              allow_missing=True,
              allow_extra=True,
          )
  
          func = TestKit.preprocess_func["mxnet"][architecture]
          img = func(image_path)
          img = np.transpose(img, [2, 0, 1])
          img = np.expand_dims(img, axis=0)
  
          model.forward(cls.Batch([mx.nd.array(img)]))
          predict = model.get_outputs()[0].asnumpy()
          predict = np.squeeze(predict)
  
          del model
          return predict
  
      else:
          return None
  
file_path: MMdnn/mmdnn/conversion/examples/mxnet/extractor.py
imports: from __future__ import absolute_import
  from mmdnn.conversion.examples.imagenet_test import TestKit
  from mmdnn.conversion.examples.extractor import base_extractor
  from mmdnn.conversion.common.utils import download_file
label_desc: Use image node_id 2 for calling the mxnet_extractor obj's underlying member method code with example usage: obj.inference(cls, architecture, files, path, image_path) and returns: predict, None