# tf.compat.v1.lite.toco_convert

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/lite/python/convert.py#L973-L999) |

Convert a TensorFlow GraphDef to TFLite. (deprecated)

    tf.compat.v1.lite.toco_convert(
        input_data, input_tensors, output_tensors, *args, **kwargs
    )

> [!WARNING]
> **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`lite.TFLiteConverter`](https://www.tensorflow.org/lite/api_docs/python/tf/lite/TFLiteConverter) instead.

This function is deprecated. Please use [`tf.lite.TFLiteConverter`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/lite/TFLiteConverter) API instead.
Conversion can be customized by providing arguments that are forwarded to
`build_model_flags` and `build_conversion_flags` (see documentation for
details).
Args:
input_data: Input data (i.e. often `sess.graph_def`).
input_tensors: List of input tensors. Type and shape are computed using
`foo.shape` and `foo.dtype`.
output_tensors: List of output tensors (only .name is used from this).
\*args: See `build_model_flags` and `build_conversion_flags`.
\*\*kwargs: See `build_model_flags` and `build_conversion_flags`.

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The converted TensorFlow Lite model in a bytes array. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| Defined in `convert`. ||

<br />