Imported Upstream version 1.4.0
[platform/core/ml/nnfw.git] / tools / nnpackage_tool / tf2tfliteV2 / README.md
1 # tf2tfliteV2
2
3 _tf2tfliteV2_ is a TensorFlow to TensorFlow Lite model Converter.
4
5 ## Where does V2 come from?
6 Even though we alreay have _tf2tflite_, we cannot cover all opeartors in TensorFlow. To expand coverage, we introduce _tf2tfliteV2_ which uses `TensorFlow Lite Converter`(by Google) internally.
7
8 ## Prerequisite
9 - Frozen graph from TensorFlow 1.13.1
10 - Desired version of TensorFlow(You can use python virtualenv, docker, etc.)
11
12 ## Example
13 ```
14 python tf2tfliteV2.py \
15 > --v1 \
16 > --input_path=frozen_graph.pb \
17 > --output_path=converted.tflite \
18 > --input_arrays=model_inputs \
19 > --output_arrays=model_outputs
20
21 ```
22 ```
23 python tf2tfliteV2.py \
24 > --v2 \
25 > --input_path=frozen_graph.pb \
26 > --output_path=converted.tflite \
27 > --input_arrays=model_inputs \
28 > --output_arrays=model_outputs
29 ```
30
31 ## optional argument
32 ```
33   -h, --help            show this help message and exit
34   --v1                  Use TensorFlow Lite Converter 1.x
35   --v2                  Use TensorFlow Lite Converter 2.x
36   --input_path INPUT_PATH
37                         Full filepath of the input file.
38   --output_path OUTPUT_PATH
39                         Full filepath of the output file.
40   --input_arrays INPUT_ARRAYS
41                         Names of the input arrays, comma-separated.
42   --input_shapes INPUT_SHAPES
43                         Shapes corresponding to --input_arrays, colon-
44                         separated.
45   --output_arrays OUTPUT_ARRAYS
46                         Names of the output arrays, comma-separated.
47 ```