code: def get_tf_keras_io_names(model):
      """
      Utility function to get tf.keras inputs/outputs names from a tf.keras model.
  
      Parameter
      ---------
      model: tf.keras.Model
      """
      input_names, output_names = [], []
      try:
          # The order of outputs in conc_func.structured_outputs is the same order
          # that Keras predicts in, which can be different from model.outputs
          input_signature = _saving_utils.model_input_signature(
              model, keep_original_batch_size=True
          )
          fn = _saving_utils.trace_model_call(model, input_signature)
          conc_func = fn.get_concrete_function()
          for key in conc_func.structured_outputs:
              output_names.append(
                  conc_func.structured_outputs[key].name.split(":")[0]
              )
      except:
          for o in model.outputs:
              output_names.append(o.name.split(":")[0].split("/")[-1])
      for name in model.input_names:
          input_names.append(name.split(":")[0])
      return input_names, output_names
  
imports: import os
  import tempfile
  import numpy
  import pytest
  import coremltools.models.utils
  from coremltools._deps import _HAS_TF_2
  from coremltools.converters.mil.testing_reqs import ct
  from coremltools.converters.mil.testing_utils import compare_backend, ct_convert, validate_minimum_deployment_target
  from tensorflow.python.framework import dtypes
  from tensorflow.python.keras.saving import saving_utils
  from tensorflow.python.tools.freeze_graph import freeze_graph
label_desc: Use image node_id 2 for calling a global function with example usage: get_tf_keras_io_names(model) and returns: input_names,  output_names