code: def _from_tf_keras_model(keras_model):
      from tensorflow.python.framework.convert_to_constants import (
          convert_variables_to_constants_v2,
      )
      from tensorflow.python.keras.saving import saving_utils
  
      if not isinstance(keras_model, tf.keras.Model):
          keras_model = tf.keras.models.load_model(keras_model, None)
  
      tf.keras.backend.clear_session()
      tf.keras.backend.set_learning_phase(False)
      fn = saving_utils.trace_model_call(keras_model)
      cf = fn.get_concrete_function()
      try:
          frozen_fn = convert_variables_to_constants_v2(cf)
          return frozen_fn.graph.as_graph_def(add_shapes=True)
      except Exception:
          raise NotImplementedError("Unhandled tf.keras model format")
  
imports: import gc
  import os
  from distutils.version import StrictVersion
  from tempfile import mktemp
  import tensorflow
  from tqdm import tqdm
  from coremltools import _logger
  from coremltools._deps import _get_version
  from coremltools.converters._profile_utils import _profile
  from .._utils import get_output_names
  from .basic_graph_ops import fill_outputs
  from .converter import TFConverter
  from .parsed_tf_node import ParsedTFNode
  from .tf_graph_pass import cond_to_where, constant_propagation, delete_asserts, delete_disconnected_nodes, delete_unnecessary_constant_nodes, functionalize_loops, fuse_dilation_conv, insert_get_tuple, quantization_pass, remove_variable_nodes, tensor_array_resource_removal
  from .tfssa import NetworkEnsemble, SSAFunction
label_desc: Use image node_id 6 for calling the TF1Loader obj's underlying member method code with example usage: obj._from_tf_keras_model(keras_model) and returns: frozen_fn