aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mark Daoust <markdaoust@google.com>2018-10-09 17:23:45 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-09 17:28:19 -0700
commitee1cb110360b12d752c9cb4ebbb76d33930f67d7 (patch)
tree2c10fc5b501acd262883340bd82783ca3f6479d1
parent5be479930d3dcfa3edb863703b1d73b89d45f03c (diff)
Move tflite_convert g3docs, so they will be pulled into the site.
PiperOrigin-RevId: 216452447
-rw-r--r--tensorflow/contrib/lite/g3doc/_book.yaml9
-rw-r--r--tensorflow/contrib/lite/g3doc/tflite_convert/cmdline_examples.md (renamed from tensorflow/contrib/lite/toco/g3doc/cmdline_examples.md)54
-rw-r--r--tensorflow/contrib/lite/g3doc/tflite_convert/cmdline_reference.md (renamed from tensorflow/contrib/lite/toco/g3doc/cmdline_reference.md)17
-rw-r--r--tensorflow/contrib/lite/g3doc/tflite_convert/index.md22
-rw-r--r--tensorflow/contrib/lite/g3doc/tflite_convert/python_api.md (renamed from tensorflow/contrib/lite/toco/g3doc/python_api.md)29
-rw-r--r--tensorflow/contrib/lite/g3doc/tflite_convert/toco_landscape.svg (renamed from tensorflow/contrib/lite/toco/g3doc/toco_landscape.svg)0
-rw-r--r--tensorflow/contrib/lite/toco/g3doc/README.md3
7 files changed, 63 insertions, 71 deletions
diff --git a/tensorflow/contrib/lite/g3doc/_book.yaml b/tensorflow/contrib/lite/g3doc/_book.yaml
index de6914e536..f6ec387ad2 100644
--- a/tensorflow/contrib/lite/g3doc/_book.yaml
+++ b/tensorflow/contrib/lite/g3doc/_book.yaml
@@ -38,6 +38,15 @@ upper_tabs:
path: /lite/ios
- title: TensorFlow Lite for Raspberry Pi
path: /lite/rpi
+ - heading: TFLite Converter
+ - title: Overview
+ path: /lite/tflite_convert/
+ - title: Python API
+ path: /lite/tflite_convert/python_api
+ - title: Command Line Examples
+ path: /lite/tflite_convert/cmdline_examples
+ - title: Command Line Reference
+ path: /lite/tflite_convert/cmdline_reference
- title: TF Mobile
style: accordion
diff --git a/tensorflow/contrib/lite/toco/g3doc/cmdline_examples.md b/tensorflow/contrib/lite/g3doc/tflite_convert/cmdline_examples.md
index e3c46eb377..d88acfae80 100644
--- a/tensorflow/contrib/lite/toco/g3doc/cmdline_examples.md
+++ b/tensorflow/contrib/lite/g3doc/tflite_convert/cmdline_examples.md
@@ -1,33 +1,8 @@
# TensorFlow Lite Converter command-line examples
-This page shows how to use the TensorFlow Lite Converter in the command line. It
-is complemented by the following documents:
-
-* [README](../README.md)
-* [Command-line glossary](cmdline_reference.md)
-* [Python API examples](python_api.md)
-
-Table of contents:
-
-* [Command-line tools](#tools)
- * [Converting models prior to TensorFlow 1.9](#pre-tensorflow-1.9)
-* [Basic examples](#basic)
- * [Convert a TensorFlow GraphDef](#graphdef)
- * [Convert a TensorFlow SavedModel](#savedmodel)
- * [Convert a tf.keras model](#keras)
-* [Quantization](#quantization)
- * [Convert a TensorFlow GraphDef for quantized inference](#graphdef-quant)
- * [Use "dummy-quantization" to try out quantized inference on a float
- graph](#dummy-quant)
-* [Specifying input and output arrays](#specifying-input-and-output-arrays)
- * [Multiple input arrays](#multiple-input-arrays)
- * [Multiple output arrays](#multiple-output-arrays)
- * [Specifying subgraphs](#specifying-subgraphs)
-* [Graph visualizations](#graph-visualizations)
- * [Using --output_format=GRAPHVIZ_DOT](#using-output-format-graphviz-dot)
- * [Using --dump_graphviz_dir](#using-dump-graphviz-dir)
- * [Graph "video" logging](#graph-video-logging)
- * [Legend for the graph visualizations](#graphviz-legend)
+This page shows how to use the TensorFlow Lite Converter in the command line.
+
+[TOC]
## Command-line tools <a name="tools"></a>
@@ -325,10 +300,23 @@ As before, these can be rendered to PDFs:
dot -Tpdf -O /tmp/toco_*.dot
```
-Sample output files can be seen here:
-
-* [toco_AT_IMPORT.dot.pdf](https://storage.googleapis.com/download.tensorflow.org/example_images/toco_AT_IMPORT.dot.pdf)
-* [toco_AFTER_TRANSFORMATIONS.dot.pdf](https://storage.googleapis.com/download.tensorflow.org/example_images/toco_AFTER_TRANSFORMATIONS.dot.pdf).
+Sample output files can be seen here below. Note that it is the same
+`AveragePool` node in the top right of each image.
+
+<table><tr>
+ <td>
+ <a target="_blank" href="https://storage.googleapis.com/download.tensorflow.org/example_images/toco_AT_IMPORT.dot.pdf">
+ <img src="https://www.tensorflow.org/images/tflite_convert/tflite_convert_before.png"/>
+ </a>
+ </td>
+ <td>
+ <a target="_blank" href="https://storage.googleapis.com/download.tensorflow.org/example_images/toco_AFTER_TRANSFORMATIONS.dot.pdf">
+ <img src="https://www.tensorflow.org/images/tflite_convert/tflite_convert_after.png"/>
+ </a>
+ </td>
+</tr>
+<tr><td>before</td><td>after</td></tr>
+</table>
### Graph "video" logging
@@ -347,7 +335,7 @@ change was introduced in the graph.
* Some typically heavy operators (e.g. Conv) are rendered in a
<span style="background-color:#c53929;color:white;border:1px;border-style:solid;border-color:black;padding:1px">darker
red</span>.
-* Arrays are octogons with the following colors:
+* Arrays are octagons with the following colors:
* Constant arrays are
<span style="background-color:#4285f4;color:white;border:1px;border-style:solid;border-color:black;padding:1px">blue</span>.
* Activation arrays are gray:
diff --git a/tensorflow/contrib/lite/toco/g3doc/cmdline_reference.md b/tensorflow/contrib/lite/g3doc/tflite_convert/cmdline_reference.md
index 31200fd657..d65912fea6 100644
--- a/tensorflow/contrib/lite/toco/g3doc/cmdline_reference.md
+++ b/tensorflow/contrib/lite/g3doc/tflite_convert/cmdline_reference.md
@@ -2,18 +2,9 @@
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. It is complemented by the following other documents:
+recent build of TensorFlow.
-* [README](../README.md)
-* [Command-line examples](cmdline_examples.md)
-* [Python API examples](python_api.md)
-
-Table of contents:
-
-* [High-level flags](#high-level-flags)
-* [Model flags](#model-flags)
-* [Transformation flags](#transformation-flags)
-* [Logging flags](#logging-flags)
+[TOC]
## High-level flags
@@ -32,7 +23,7 @@ files. The flag `--output_file` is always required. Additionally, either
* `--output_format`. Type: string. Default: `TFLITE`. Specifies the format of
the output file. Allowed values:
* `TFLITE`: TensorFlow Lite FlatBuffer format.
- * `GRAPHVIZ_DOT`: GraphViz `.dot` format containg a visualization of the
+ * `GRAPHVIZ_DOT`: GraphViz `.dot` format containing a visualization of the
graph after graph transformations.
* Note that passing `GRAPHVIZ_DOT` to `--output_format` leads to loss
of TFLite specific transformations. Therefore, the resulting
@@ -68,7 +59,7 @@ based on index.
* `--input_shapes`. Type: colon-separated list of comma-separated lists of
integers. Each comma-separated list of integers gives the shape of one of
the input arrays specified in
- [TensorFlow convention](https://www.tensorflow.org/versions/r1.2/programmers_guide/dims_types#shape).
+ [TensorFlow convention](https://www.tensorflow.org/guide/dims_types#shape).
* Example: `--input_shapes=1,60,80,3` for a typical vision model means a
batch size of 1, an input image height of 60, an input image width of
80, and an input image depth of 3 (representing RGB channels).
diff --git a/tensorflow/contrib/lite/g3doc/tflite_convert/index.md b/tensorflow/contrib/lite/g3doc/tflite_convert/index.md
new file mode 100644
index 0000000000..12ba0225f6
--- /dev/null
+++ b/tensorflow/contrib/lite/g3doc/tflite_convert/index.md
@@ -0,0 +1,22 @@
+# TensorFlow Lite Converter
+
+The TensorFlow Lite Converter converts TensorFlow graphs into
+TensorFlow Lite graphs. There are additional usages that are also detailed in
+the usage documentation.
+
+
+## Where the converter fits in the TensorFlow landscape
+
+Once an application developer has a trained TensorFlow model, the TensorFlow
+Lite Converter will accept
+that model and generate a TensorFlow Lite
+[FlatBuffer](https://google.github.io/flatbuffers/) file. The converter currently supports
+[SavedModels](https://www.tensorflow.org/guide/saved_model#using_savedmodel_with_estimators),
+frozen graphs (models generated via
+[freeze_graph.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/freeze_graph.py)),
+and `tf.Keras` model files. The TensorFlow Lite FlatBuffer file can be shipped
+to client devices, generally mobile devices, where the TensorFlow Lite
+interpreter handles them on-device. This flow is represented in the diagram
+below.
+
+![drawing](toco_landscape.svg)
diff --git a/tensorflow/contrib/lite/toco/g3doc/python_api.md b/tensorflow/contrib/lite/g3doc/tflite_convert/python_api.md
index 1f741360c6..e1c0e0c240 100644
--- a/tensorflow/contrib/lite/toco/g3doc/python_api.md
+++ b/tensorflow/contrib/lite/g3doc/tflite_convert/python_api.md
@@ -1,31 +1,10 @@
# TensorFlow Lite Converter & Interpreter Python API reference
This page provides examples on how to use the TensorFlow Lite Converter and the
-TensorFlow Lite interpreter using the Python API. It is complemented by the
-following documents:
-
-* [README](../README.md)
-* [Command-line examples](cmdline_examples.md)
-* [Command-line glossary](cmdline_reference.md)
-
-Table of contents:
-
-* [High-level overview](#high-level-overview)
-* [API](#api)
-* [Basic examples](#basic)
- * [Exporting a GraphDef from tf.Session](#basic-graphdef-sess)
- * [Exporting a GraphDef from file](#basic-graphdef-file)
- * [Exporting a SavedModel](#basic-savedmodel)
- * [Exporting a tf.keras File](#basic-keras-file)
-* [Complex examples](#complex)
- * [Exporting a quantized GraphDef](#complex-quant)
-* [TensorFlow Lite Python interpreter](#interpreter)
- * [Using the interpreter from a model file](#interpreter-file)
- * [Using the interpreter from model data](#interpreter-data)
-* [Additional instructions](#additional-instructions)
- * [Build from source code](#latest-package)
- * [Converting models in TensorFlow 1.9 to TensorFlow 1.11](#pre-tensorflow-1.11)
- * [Converting models prior to TensorFlow 1.9](#pre-tensorflow-1.9)
+TensorFlow Lite interpreter using the Python API.
+
+[TOC]
+
## High-level overview
diff --git a/tensorflow/contrib/lite/toco/g3doc/toco_landscape.svg b/tensorflow/contrib/lite/g3doc/tflite_convert/toco_landscape.svg
index 335debde57..335debde57 100644
--- a/tensorflow/contrib/lite/toco/g3doc/toco_landscape.svg
+++ b/tensorflow/contrib/lite/g3doc/tflite_convert/toco_landscape.svg
diff --git a/tensorflow/contrib/lite/toco/g3doc/README.md b/tensorflow/contrib/lite/toco/g3doc/README.md
new file mode 100644
index 0000000000..2153b6cc63
--- /dev/null
+++ b/tensorflow/contrib/lite/toco/g3doc/README.md
@@ -0,0 +1,3 @@
+# TOCO
+
+These files have moved to [../../g3doc/tflite_convert](../../g3doc/tflite_convert)