code: def _main(_):
      # cannot convert savedmodel with empty SignatureMap
      model = saved_model.load(FLAGS.model)
      if len(model.signatures) == 0:
          logger.info(
              "Savedmodel cannot be converted with empty signature map! Please check model.signatures before conversion."
          )
          raise ValueError
  
      converter = create_converter(FLAGS.model, model_loader)
      tflite_model = converter.convert()
      with open(FLAGS.output, "wb") as f:
          f.write(tflite_model)
  
file_path: auptimizer/src/aup/dlconvert/savedmodel_to_tflite.py
imports: from os import path, environ
  from tensorflow import lite, keras, saved_model
  from absl import flags, app
  from .utils import reset_flag
  import logging
  import coloredlogs
  from ..utils import LOG_LEVEL
  from .to_tflite import create_converter
label_desc: Use image node_id 2 for calling a global function with example usage: _main(_) without return types