code: def main(_):
      tf.logging.set_verbosity(tf.logging.INFO)
      trainer_lib.set_random_seed(FLAGS.random_seed)
      usr_dir.import_usr_dir(FLAGS.t2t_usr_dir)
  
      if FLAGS.checkpoint_path:
          checkpoint_path = FLAGS.checkpoint_path
          ckpt_dir = os.path.dirname(checkpoint_path)
      else:
          ckpt_dir = os.path.expanduser(FLAGS.output_dir)
          checkpoint_path = tf.train.latest_checkpoint(ckpt_dir)
  
      hparams = create_hparams()
      hparams.no_data_parallelism = True  # To clear the devices
      problem = hparams.problem
      decode_hparams = decoding.decode_hparams(FLAGS.decode_hparams)
  
      export_dir = FLAGS.export_dir or os.path.join(ckpt_dir, "export")
  
      if FLAGS.export_as_tfhub:
          checkpoint_path = tf.train.latest_checkpoint(ckpt_dir)
          export_as_tfhub_module(
              FLAGS.model,
              hparams,
              decode_hparams,
              problem,
              checkpoint_path,
              export_dir,
          )
          return
  
      run_config = t2t_trainer.create_run_config(hparams)
  
      estimator = create_estimator(run_config, hparams)
  
      exporter = tf_estimator.FinalExporter(
          "exporter",
          lambda: problem.serving_input_fn(
              hparams, decode_hparams, FLAGS.use_tpu
          ),
          as_text=FLAGS.as_text,
      )
  
      exporter.export(
          estimator,
          export_dir,
          checkpoint_path=checkpoint_path,
          eval_result=None,
          is_the_final_export=True,
      )
  
file_path: tensor2tensor/tensor2tensor/serving/export.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from tensor2tensor.bin import t2t_trainer
  from tensor2tensor.utils import decoding
  from tensor2tensor.utils import t2t_model
  from tensor2tensor.utils import trainer_lib
  from tensor2tensor.utils import usr_dir
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_hub
label_desc: Use image node_id 6 for calling a global function with example usage: main(_) without return types