class_docstr: FrozenModel
class_docstr_tok: ["FrozenModel"]
code: def init_session(self, model, gpu_str):
      # The config for CPU usage
      config = tf.ConfigProto()
      if not gpu_str:
          config.gpu_options.visible_device_list = (
              ""  # pylint: disable=no-member
          )
      else:
          config.gpu_options.visible_device_list = (
              gpu_str  # pylint: disable=no-member
          )
          config.gpu_options.allow_growth = (
              True  # pylint: disable=no-member
          )
  
      # check model dir
      if os.path.isdir(model):
          self._graph = tf.Graph()
  
          if tf.saved_model.maybe_saved_model_directory(model):
              # saved model
              logging.info("saved model dir: {}".format(model))
              self._sess = tf.Session(graph=self._graph, config=config)
              tf.saved_model.loader.load(
                  self._sess,
                  [tf.saved_model.tag_constants.SERVING],
                  model,
              )
          else:
              # checkpoint
              self._sess = tf.Session(
                  graph=self._graph,
                  config=tf.ConfigProto(
                      allow_soft_placement=True,
                      log_device_placement=True,
                  ),
              )
              ckpt_path = tf.train.latest_checkpoint(model)
              # self._graph, self._sess = utils.load_graph_session_from_ckpt(ckpt_path)
              model = ckpt_path + ".meta"
              logging.info("meta : {}".format(model))
              saver = tf.train.import_meta_graph(model)
              saver.restore(self._sess, ckpt_path)
  
      else:
          if not os.path.exists(model):
              logging.info("{}, is not exist".format(model))
              logging.info("frozen_graph : {} not exist".format(model))
              sys.exit(0)
  
          # frozen graph pb
          frozen_graph = model
          logging.info("frozen graph pb : {}".format(frozen_graph))
          self._graph = utils.load_frozen_graph(frozen_graph)
          self._sess = tf.Session(graph=self._graph, config=config)
  
imports: import os
  import sys
  import abc
  from absl import logging
  import delta.compat
  from delta import utils
label_desc: Use image node_id 2 for calling the FrozenModel obj's underlying member method code with example usage: obj.init_session(model, gpu_str) without return types