code: def convert(checkpoint_meta_file: str, output_nodes: List[str] = ()):
      """Convert TF Checkpoint to TFLite model
  
      Args:
          checkpoint_meta_file (str): checkpoint meta file name
          output_nodes (List[str], optional): A list of output node names for frozen graph. Defaults to ().
  
      Returns:
          tflite model
  
      """
      model_dir = path.dirname(checkpoint_meta_file)
      ckpt = tf.train.get_checkpoint_state(model_dir)
      # check if valid checkpoint file can be loaded
      if ckpt is None:
          return None
      # convert to frozen graph first
      g = tf.Graph()
      with g.as_default():
          saver = tf.train.import_meta_graph(
              ckpt.model_checkpoint_path + ".meta", clear_devices=True
          )
          graph_def = g.as_graph_def()
      with tf.Session(graph=g) as sess:
          saver.restore(sess, ckpt.model_checkpoint_path)
          graph_def = to_frozen(sess, output_nodes)
  
      with open("tmp.pb", "wb") as fp:
          fp.write(graph_def.SerializeToString())
      # convert from froze protobuf to tflite
      converter = create_converter("tmp.pb", model_loader)
      tflite_model = converter.convert()
  
      remove("tmp.pb")
      return tflite_model
  
file_path: auptimizer/src/aup/dlconvert/checkpoint_to_tflite.py
imports: from os import path, remove
  from typing import List
  import tensorflow.compat.v1
  from absl import flags, app
  from .utils import reset_flag
  import logging
  from .to_frozen_pb import to_frozen
  from .pb_to_tflite import model_loader
  from .to_tflite import create_converter
label_desc: Use image node_id 1 for calling a global function with example usage: convert(checkpoint_meta_file, output_nodes) and returns: tflite_model, None