code: def validate_keras_model(
      platform,
      model_file,
      input_file,
      mace_out_file,
      input_names,
      input_shapes,
      input_data_formats,
      output_names,
      output_shapes,
      output_data_formats,
      validation_threshold,
      input_data_types,
      log_file,
  ):
      from tensorflow import keras
      import tensorflow_model_optimization as tfmot
  
      if not os.path.isfile(model_file):
          util.MaceLogger.error(
              VALIDATION_MODULE,
              "Input model file '" + model_file + "' does not exist!",
          )
  
      with tfmot.quantization.keras.quantize_scope():
          keras_model = keras.models.load_model(
              model_file, compile=False
          )
  
          input = []
          for i in range(len(input_names)):
              input_value = load_data(
                  util.formatted_file_name(input_file, input_names[i]),
                  input_data_types[i],
              )
              input_value = input_value.reshape(input_shapes[i])
              if (
                  input_data_formats[i] == DataFormat.NCHW
                  and len(input_shapes[i]) == 4
              ):
                  input_value = input_value.transpose((0, 2, 3, 1))
              elif (
                  input_data_formats[i] == DataFormat.OIHW
                  and len(input_shapes[i]) == 4
              ):
                  # OIHW -> HWIO
                  input_value = input_value.transpose((2, 3, 1, 0))
              input.append(input_value)
  
          output_values = keras_model.predict(input)
  
          mace_check(len(output_names) == 1, "Unexpected")
  
          for i in range(len(output_names)):
              output_file_name = util.formatted_file_name(
                  mace_out_file, output_names[i]
              )
              mace_out_value = load_data(
                  output_file_name,
                  get_data_type_by_value(output_values),
              )
              (
                  mace_out_value,
                  real_output_shape,
                  real_output_data_format,
              ) = get_real_out_value_shape_df(
                  platform,
                  mace_out_value,
                  output_shapes[i],
                  output_data_formats[i],
              )
              compare_output(
                  output_names[i],
                  mace_out_value,
                  output_values,
                  validation_threshold,
                  log_file,
                  real_output_shape,
                  real_output_data_format,
              )
  
imports: import os
  import sys
  import os.path
  import numpy
  import six
  from py_proto import mace_pb2
  from utils import util
  from utils.config_parser import DataFormat
  from utils.config_parser import Platform
  from utils.util import mace_check
label_desc: Use image node_id 16 for calling a global function with example usage: validate_keras_model(platform, model_file, input_file, mace_out_file, input_names, input_shapes, input_data_formats, output_names, output_shapes, output_data_formats, validation_threshold, input_data_types, log_file) without return types