Add link for 1.X converter docs in 2.0.

PiperOrigin-RevId: 276053272
Change-Id: I16a25a444652e1ee7e1b9b14cbb41f104a8e969f
This commit is contained in:
Nupur Garg 2019-10-22 06:35:55 -07:00 committed by TensorFlower Gardener
parent 5460af59bc
commit c474877e2b
7 changed files with 30 additions and 35 deletions

View File

@ -1,8 +1,14 @@
# Converter command line reference
This page describes how to use the [TensorFlow Lite converter](index.md) using
the command line tool in TensorFlow 2.0. The preferred approach for conversion
is using the [Python API](python_api.md).
the command line tool. The preferred approach for conversion is using the
[Python API](python_api.md).
Note: This only contains documentation on the command line tool in TensorFlow 2.
Documentation on using the command line tool in TensorFlow 1 is available on
GitHub
([reference](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/r1/convert/cmdline_reference.md),
[example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/r1/convert/cmdline_examples.md)).
[TOC]
@ -21,9 +27,9 @@ The following flags specify the input and output files.
* `--output_file`. Type: string. Specifies the full path of the output file.
* `--saved_model_dir`. Type: string. Specifies the full path to the directory
containing the SavedModel generated in 1.X or 2.0.
containing the SavedModel generated in 1.X or 2.X.
* `--keras_model_file`. Type: string. Specifies the full path of the HDF5 file
containing the `tf.keras` model generated in 1.X or 2.0.
containing the `tf.keras` model generated in 1.X or 2.X.
The following is an example usage.
@ -33,6 +39,14 @@ tflite_convert \
--output_file=/tmp/mobilenet.tflite
```
In addition to the input and output flags, the converter contains the following
flag.
* `--enable_v1_converter`. Type: bool. Enables user to enable the 1.X command
line flags instead of the 2.X flags. The 1.X command line flags are
specified
[here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/r1/convert/cmdline_reference.md).
## Additional instructions
### Building from source

View File

@ -1,15 +1,19 @@
# Converter Python API guide
This page provides examples on how to use the
[TensorFlow Lite converter](index.md) using the Python API in TensorFlow 2.0.
[TensorFlow Lite converter](index.md) using the Python API.
Note: This only contains documentation on the Python API in TensorFlow 2.
Documentation on using the Python API in TensorFlow 1 is available on
[GitHub](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/r1/convert/python_api.md).
[TOC]
## Python API
The Python API for converting TensorFlow models to TensorFlow Lite in TensorFlow
2.0 is `tf.lite.TFLiteConverter`. `TFLiteConverter` provides the following
classmethods to convert a model based on the original model format:
The Python API for converting TensorFlow models to TensorFlow Lite is
`tf.lite.TFLiteConverter`. `TFLiteConverter` provides the following classmethods
to convert a model based on the original model format:
* `TFLiteConverter.from_saved_model()`: Converts
[SavedModel directories](https://www.tensorflow.org/guide/saved_model).
@ -18,14 +22,8 @@ classmethods to convert a model based on the original model format:
* `TFLiteConverter.from_concrete_functions()`: Converts
[concrete functions](concrete_function.md).
Note: TensorFlow Lite 2.0 had a different version of the
`TFLiteConverter` API which only contained the classmethod
[`from_concrete_function`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/lite/TFLiteConverter#from_concrete_function).
The API detailed in this document can be installed using the
[`tf-nightly-2.0-preview`](#installing_the_tensorflow_20_nightly_) pip install.
This document contains [example usages](#examples) of the API, a detailed list
of [changes in the API between 1.X and 2.0](#differences), and
of [changes in the API between Tensorflow 1 and TensorFlow 2](#differences), and
[instructions](#versioning) on running the different versions of TensorFlow.
## Examples <a name="examples"></a>
@ -256,23 +254,12 @@ been removed due to this issue.
## Installing TensorFlow <a name="versioning"></a>
### Installing the TensorFlow 2.0 nightly <a name="2.0-nightly"></a>
### Installing the TensorFlow nightly <a name="2.0-nightly"></a>
The TensorFlow 2.0 nightly can be installed using the following command:
The TensorFlow nightly can be installed using the following command:
```
pip install tf-nightly-2.0-preview
```
### Using TensorFlow 2.0 from a 1.X installation <a name="use-2.0-from-1.X"></a>
TensorFlow 2.0 can be enabled from recent 1.X installations using the following
code snippet.
```python
import tensorflow.compat.v2 as tf
tf.enable_v2_behavior()
pip install tf-nightly
```
### Build from source code <a name="latest_package"></a>

View File

@ -2,8 +2,6 @@
This page shows how to use the TensorFlow Lite Converter in the command line.
[TOC]
## Command-line tools <a name="tools"></a>
There are two approaches to running the converter in the command line.

View File

@ -4,8 +4,6 @@ This page is complete reference of command-line flags used by the TensorFlow
Lite Converter's command line starting from TensorFlow 1.9 up until the most
recent build of TensorFlow.
[TOC]
## High-level flags
The following high level flags specify the details of the input and output

View File

@ -10,8 +10,6 @@ Note: This page describes the converter in the TensorFlow nightly release,
installed using `pip install tf-nightly`. For docs describing older versions
reference ["Converting models from TensorFlow 1.12"](#pre_tensorflow_1.12).
[TOC]
## High-level overview