Update links for TF2
PiperOrigin-RevId: 272326185
This commit is contained in:
parent
db6be9c716
commit
4f13360866
tensorflow/lite/g3doc
@ -13,7 +13,7 @@ execution is an imperative programming environment that evaluates operations
|
||||
immediately, without building graphs. Operations return concrete values instead
|
||||
of constructing a computational graph to run later. A detailed guide on eager
|
||||
execution is available
|
||||
[here](https://github.com/tensorflow/docs/blob/r2.0rc/site/en/r2/guide/eager.ipynb).
|
||||
[here](https://www.tensorflow.org/guide/eager).
|
||||
|
||||
While running imperatively with eager execution makes development and debugging
|
||||
more interactive, it doesn't allow for deploying on-device. The `tf.function`
|
||||
@ -171,7 +171,7 @@ tf.saved_model.save(root, export_dir, concrete_func)
|
||||
```
|
||||
|
||||
Reference the
|
||||
[SavedModel guide](https://github.com/tensorflow/docs/blob/r2.0rc/site/en/r2/guide/saved_model.ipynb)
|
||||
[SavedModel guide](https://www.tensorflow.org/guide/saved_model)
|
||||
for detailed instructions on using SavedModels.
|
||||
|
||||
### How do I get a concrete function from the SavedModel?
|
||||
|
@ -3,8 +3,8 @@
|
||||
The TensorFlow Lite converter takes a TensorFlow model and generates a
|
||||
TensorFlow Lite [`FlatBuffer`](https://google.github.io/flatbuffers/) file
|
||||
(`.tflite`). The converter supports
|
||||
[SavedModel directories](https://www.tensorflow.org/alpha/guide/saved_model),
|
||||
[`tf.keras` models](https://www.tensorflow.org/alpha/guide/keras/overview), and
|
||||
[SavedModel directories](https://www.tensorflow.org/guide/saved_model),
|
||||
[`tf.keras` models](https://www.tensorflow.org/guide/keras/overview), and
|
||||
[concrete functions](concrete_function.md).
|
||||
|
||||
Note: This page contains documentation on the converter API for TensorFlow 2.0.
|
||||
|
@ -12,13 +12,13 @@ The Python API for converting TensorFlow models to TensorFlow Lite in TensorFlow
|
||||
classmethods to convert a model based on the original model format:
|
||||
|
||||
* `TFLiteConverter.from_saved_model()`: Converts
|
||||
[SavedModel directories](https://www.tensorflow.org/alpha/guide/saved_model).
|
||||
[SavedModel directories](https://www.tensorflow.org/guide/saved_model).
|
||||
* `TFLiteConverter.from_keras_model()`: Converts
|
||||
[`tf.keras` models](https://www.tensorflow.org/alpha/guide/keras/overview).
|
||||
[`tf.keras` models](https://www.tensorflow.org/guide/keras/overview).
|
||||
* `TFLiteConverter.from_concrete_functions()`: Converts
|
||||
[concrete functions](concrete_function.md).
|
||||
|
||||
Note: The TensorFlow Lite 2.0 alpha had a different version of the
|
||||
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
|
||||
@ -33,7 +33,7 @@ of [changes in the API between 1.X and 2.0](#differences), and
|
||||
### Converting a SavedModel <a name="saved_model"></a>
|
||||
|
||||
The following example shows how to convert a
|
||||
[SavedModel](https://www.tensorflow.org/alpha/guide/saved_model) into a
|
||||
[SavedModel](https://www.tensorflow.org/guide/saved_model) into a
|
||||
TensorFlow Lite [`FlatBuffer`](https://google.github.io/flatbuffers/).
|
||||
|
||||
```python
|
||||
@ -72,7 +72,7 @@ converter = TFLiteConverter.from_concrete_functions([concrete_func])
|
||||
### Converting a Keras model <a name="keras"></a>
|
||||
|
||||
The following example shows how to convert a
|
||||
[`tf.keras` model](https://www.tensorflow.org/alpha/guide/keras/overview) into a
|
||||
[`tf.keras` model](https://www.tensorflow.org/guide/keras/overview) into a
|
||||
TensorFlow Lite [`FlatBuffer`](https://google.github.io/flatbuffers/).
|
||||
|
||||
```python
|
||||
|
@ -106,28 +106,28 @@ tflite_model = converter.convert()
|
||||
open("converted_model.tflite", "wb").write(tflite_model)
|
||||
```
|
||||
|
||||
You can [convert TensorFlow 2.0 models](../r2/convert) in a similar way.
|
||||
You can [convert TensorFlow 2.0 models](../convert/index.md) in a similar way.
|
||||
|
||||
The converter can also be used from the
|
||||
[command line](../convert/cmdline_examples), but the Python API is recommended.
|
||||
[command line](../convert/cmdline.md), but the Python API is recommended.
|
||||
|
||||
### Options
|
||||
|
||||
The converter can convert from a variety of input types.
|
||||
|
||||
When [converting TensorFlow 1.x models](../convert/python_api), these are:
|
||||
When [converting TensorFlow 1.x models](../convert/python_api.md), these are:
|
||||
|
||||
* [SavedModel directories](https://www.tensorflow.org/alpha/guide/saved_model)
|
||||
* [SavedModel directories](https://www.tensorflow.org/guide/saved_model)
|
||||
* Frozen GraphDef (models generated by
|
||||
[freeze_graph.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/freeze_graph.py))
|
||||
* [Keras](https://keras.io) HDF5 models
|
||||
* Models taken from a `tf.Session`
|
||||
|
||||
When [converting TensorFlow 2.x models](../r2/convert/python_api), these are:
|
||||
When [converting TensorFlow 2.x models](../convert/python_api.md), these are:
|
||||
|
||||
* [SavedModel directories](https://www.tensorflow.org/alpha/guide/saved_model)
|
||||
* [`tf.keras` models](https://www.tensorflow.org/alpha/guide/keras/overview)
|
||||
* [Concrete functions](../r2/convert/concrete_function.md)
|
||||
* [SavedModel directories](https://www.tensorflow.org/guide/saved_model)
|
||||
* [`tf.keras` models](https://www.tensorflow.org/guide/keras/overview)
|
||||
* [Concrete functions](../convert/concrete_function.md)
|
||||
|
||||
The converter can be configured to apply various optimizations that can improve
|
||||
performance or reduce file size. This is covered in section 4,
|
||||
|
@ -6,7 +6,7 @@ they can be used by the TensorFlow Lite interpreter.
|
||||
|
||||
Note: This page contains documentation on the converter API for TensorFlow 1.x.
|
||||
The API for TensorFlow 2.0 is available
|
||||
[here](https://www.tensorflow.org/lite/r2/convert/).
|
||||
[here](https://www.tensorflow.org/lite/convert/).
|
||||
|
||||
## FlatBuffers
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user