Minor changes to TFLiteConverter 2.0 documentation.

PiperOrigin-RevId: 258256417
This commit is contained in:
Nupur Garg 2019-07-15 16:04:31 -07:00 committed by TensorFlower Gardener
parent 2beeba1eb6
commit 13305668a3
2 changed files with 14 additions and 1 deletions

View File

@ -56,6 +56,19 @@ converter = tf.lite.TFLiteConverter.from_saved_model(export_dir)
tflite_model = converter.convert()
```
This API does not have the option of specifying the input shape of any input
arrays. If your model requires specifying the input shape, use the
[`from_concrete_functions`](#concrete_function) classmethod instead. The code
looks similar to the following:
```python
model = tf.saved_model.load(export_dir)
concrete_func = model.signatures[
tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY]
concrete_func.inputs[0].set_shape([1, 256, 256, 3])
converter = TFLiteConverter.from_concrete_functions([concrete_func])
```
### Converting a Keras model <a name="keras"></a>
The following example shows how to convert a

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 98 KiB