Skip to content

Commit

Permalink
docs: update pytorch2tflite guide
Browse files Browse the repository at this point in the history
  • Loading branch information
LynnL4 committed May 10, 2023
1 parent c573187 commit 5c4612d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/tutorials/export/pytorch_2_tflite.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ python3 tools/torch2tflite.py \
--checkpoint <CHECKPOINT_FILE_PATH> \
--type <TYPE> \
--simplify <SIMPLIFY> \
--algorithm <ALGORITHM> \
--backend <BACKEND> \
--shape <SHAPE> \
--cfg-options <CFG_OPTIONS>
```
Expand All @@ -56,10 +58,14 @@ You need to replace the above parameters according to the actual scenario, the d

- `<CHECKPOINT_FILE_PATH>` - Path to the model weights file

- `<TYPE>` - Precision of the TFlite model, choose from: `['int8', 'fp16', 'fp32']`, default `int8`
- `<TYPE>` - Precision of the TFlite model, choose from: `['int8', 'uint8', 'float32']`, default `int8`

- `<SIMPLIFY>` - (Optional) Whether to simplify the model, default `False`

- `<algorithm>` - (Optional) Algorithm used for model quantization, choose from: `['l2', 'kl']`, default `kl`

- `<BACKEND>` - (Optional) Backend used for model quantization, choose from: `['qnnpack', 'fbgemm']`, default `qnnpack`

- `<SHAPE>` - (Optional) The dimensionality of the model's input tensor

- `<CFG_OPTIONS>` - (Optional) Configuration file parameter override, please refer to [Config - Parameterized Configuration](../config.md#parameterized-configuration)
Expand Down
8 changes: 7 additions & 1 deletion docs/zh_cn/tutorials/export/pytorch_2_tflite.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ python3 tools/torch2tflite.py \
--checkpoint <CHECKPOINT_FILE_PATH> \
--type <TYPE> \
--simplify <SIMPLIFY> \
--algorithm <ALGORITHM> \
--backend <BACKEND> \
--shape <SHAPE> \
--cfg-options <CFG_OPTIONS>
```
Expand All @@ -56,10 +58,14 @@ python3 tools/torch2tflite.py \

- `<CHECKPOINT_FILE_PATH>` - 模型权重文件的路径

- `<TYPE>` - TFlite 模型的精度,可选参数: `['int8', 'fp16', 'fp32']`,默认 `int8`
- `<TYPE>` - TFlite 模型的精度,可选参数: `['int8', 'uint8', 'float32']`,默认 `int8`

- `<SIMPLIFY>` - (可选) 是否简化模型,默认 `False`

- `<ALGORITHM>` - (可选) 模型量化算法,可选参数: `['l2', 'kl']`,默认 `l2`

- `<BACKEND>` - (可选) 模型量化后端,可选参数: `['qnnpack', 'fbgemm']`,默认 `qnnpack`

- `<SHAPE>` - (可选) 模型的输入张量的维度

- `<CFG_OPTIONS>` - (可选) 配置文件参数覆写,具体请参考[模型配置 - EdgeLab 参数化配置](../config.md#edgelab-参数化配置)
Expand Down

0 comments on commit 5c4612d

Please sign in to comment.