class_docstr: DenseNetHandler handler class. This handler takes an image
  and returns the name of object in that image.
class_docstr_tok: ["DenseNetHandler","handler","class",".","This","handler","takes","an","image","and","returns","the","name","of","object","in","that","image","."]
code: def _load_pickled_model(self, model_dir, model_file, model_pt_path):
      model_def_path = os.path.join(model_dir, model_file)
      if not os.path.isfile(model_def_path):
          raise RuntimeError("Missing the model.py file")
  
      module = importlib.import_module(model_file.split(".")[0])
      model_class_definitions = list_classes_from_module(module)
      if len(model_class_definitions) != 1:
          raise ValueError(
              "Expected only one class as model definition. {}".format(
                  model_class_definitions
              )
          )
  
      model_class = model_class_definitions[0]
      state_dict = torch.load(
          model_pt_path, map_location=self.map_location
      )
      model = model_class()
      model.load_state_dict(state_dict)
      return model
  
file_path: serve/ts/torch_handler/densenet_handler.py
imports: import inspect
  import logging
  import os
  import importlib.util
  import time
  import io
  import torch
label_desc: Use image node_id 4 for calling the DenseNetHandler obj's underlying member method code with example usage: obj._load_pickled_model(model_dir, model_file, model_pt_path) and returns: model