code: def _from_tf_keras_model(keras_model):
      from tensorflow.python.keras.saving import saving_utils
      from tensorflow.python.framework.convert_to_constants import (
          convert_variables_to_constants_v2,
      )
  
      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: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import os
  import gc
  import six
  import tensorflow
  from tempfile import mktemp
  from .basic_graph_ops import fill_outputs
  from .converter import TFConverter
  from .tf_graph_pass import *
  from .tfssa import NetworkEnsemble, SSAFunction
  from .parsed_tf_node import ParsedTFNode
  from coremltools.converters._profile_utils import _profile
  from tqdm import tqdm
  from distutils.version import StrictVersion
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