parameters: (flags)
docstring: Calls function to convert the TensorFlow 2.0 model into a TFLite model.
  
    Args:
      flags: argparse.Namespace object.
  
    Raises:
      ValueError: Unsupported file format.
docstring_summary: Calls function to convert the TensorFlow 2.0 model into a TFLite model.
docstring_tokens: Calls function to convert the TensorFlow 2 . 0 model into a TFLite model .
function: def _convert_tf2_model(flags):
    """Calls function to convert the TensorFlow 2.0 model into a TFLite model.
  
    Args:
      flags: argparse.Namespace object.
  
    Raises:
      ValueError: Unsupported file format.
    """
    # Load the model.
    if flags.saved_model_dir:
      converter = lite.TFLiteConverterV2.from_saved_model(flags.saved_model_dir)
    elif flags.keras_model_file:
      model = keras.models.load_model(flags.keras_model_file)
      converter = lite.TFLiteConverterV2.from_keras_model(model)
  
    # Convert the model.
    tflite_model = converter.convert()
    with open(flags.output_file, "wb") as f:
      f.write(tflite_model)
function_tokens: def _convert_tf2_model ( flags ) : # Load the model. if flags . saved_model_dir : converter = lite . TFLiteConverterV2 . from_saved_model ( flags . saved_model_dir ) elif flags . keras_model_file : model = keras . models . load_model ( flags . keras_model_file ) converter = lite . TFLiteConverterV2 . from_keras_model ( model ) # Convert the model. tflite_model = converter . convert ( ) with open ( flags . output_file , "wb" ) as f : f . write ( tflite_model )