From 5c4612d7e48008546b0beecfa9b2faf325c732d3 Mon Sep 17 00:00:00 2001 From: LynnL4 Date: Wed, 10 May 2023 09:36:24 +0800 Subject: [PATCH] docs: update pytorch2tflite guide --- docs/tutorials/export/pytorch_2_tflite.md | 8 +++++++- docs/zh_cn/tutorials/export/pytorch_2_tflite.md | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/export/pytorch_2_tflite.md b/docs/tutorials/export/pytorch_2_tflite.md index 17e295ef..263323f0 100644 --- a/docs/tutorials/export/pytorch_2_tflite.md +++ b/docs/tutorials/export/pytorch_2_tflite.md @@ -44,6 +44,8 @@ python3 tools/torch2tflite.py \ --checkpoint \ --type \ --simplify \ + --algorithm \ + --backend \ --shape \ --cfg-options ``` @@ -56,10 +58,14 @@ You need to replace the above parameters according to the actual scenario, the d - `` - Path to the model weights file -- `` - Precision of the TFlite model, choose from: `['int8', 'fp16', 'fp32']`, default `int8` +- `` - Precision of the TFlite model, choose from: `['int8', 'uint8', 'float32']`, default `int8` - `` - (Optional) Whether to simplify the model, default `False` +- `` - (Optional) Algorithm used for model quantization, choose from: `['l2', 'kl']`, default `kl` + +- `` - (Optional) Backend used for model quantization, choose from: `['qnnpack', 'fbgemm']`, default `qnnpack` + - `` - (Optional) The dimensionality of the model's input tensor - `` - (Optional) Configuration file parameter override, please refer to [Config - Parameterized Configuration](../config.md#parameterized-configuration) diff --git a/docs/zh_cn/tutorials/export/pytorch_2_tflite.md b/docs/zh_cn/tutorials/export/pytorch_2_tflite.md index 9a38928c..5200d260 100644 --- a/docs/zh_cn/tutorials/export/pytorch_2_tflite.md +++ b/docs/zh_cn/tutorials/export/pytorch_2_tflite.md @@ -44,6 +44,8 @@ python3 tools/torch2tflite.py \ --checkpoint \ --type \ --simplify \ + --algorithm \ + --backend \ --shape \ --cfg-options ``` @@ -56,10 +58,14 @@ python3 tools/torch2tflite.py \ - `` - 模型权重文件的路径 -- `` - TFlite 模型的精度,可选参数: `['int8', 'fp16', 'fp32']`,默认 `int8` +- `` - TFlite 模型的精度,可选参数: `['int8', 'uint8', 'float32']`,默认 `int8` - `` - (可选) 是否简化模型,默认 `False` +- `` - (可选) 模型量化算法,可选参数: `['l2', 'kl']`,默认 `l2` + +- `` - (可选) 模型量化后端,可选参数: `['qnnpack', 'fbgemm']`,默认 `qnnpack` + - `` - (可选) 模型的输入张量的维度 - `` - (可选) 配置文件参数覆写,具体请参考[模型配置 - EdgeLab 参数化配置](../config.md#edgelab-参数化配置)