diff --git a/site/ja/guide/profiler.md b/site/ja/guide/profiler.md index 71181b709f..e5fc729306 100644 --- a/site/ja/guide/profiler.md +++ b/site/ja/guide/profiler.md @@ -561,7 +561,20 @@ for step, train_data in enumerate(dataset): -| プロファイリング API | ローカル | リモート | 複数 | ハードウェア | : : : : ワーカー : プラットフォーム : | :--------------------------- | :-------- | :-------- | :-------- | :-------- | | **TensorBoard Keras | サポート対象 | サポート | サポート | CPU、GPU | : コールバック** : : 対象外 : 対象外 : : | **`tf.profiler.experimental` | サポート対象 | サポート | サポート | CPU、GPU | : start/stop [API](https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2)** : : 対象外 : 対象外 : : | **`tf.profiler.experimental` | サポート対象 | サポート対象 | サポート対象 | CPU、GPU, | : client.trace [API](https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2)** : : : : TPU : | **コンテキストマネージャ API** | サポート対象 | サポート | サポート | CPU、GPU | : : : 対象外 : 対象外 : : +| プロファイリング API | ローカル | リモート | 複数 | ハードウェア | +: : : : ワーカー : プラットフォーム : +| :----------------------------- | :----------- | :----------- | :----------- | :-------- | +| **TensorBoard Keras | サポート対象 | サポート | サポート | CPU、GPU | +: コールバック** : : 対象外 : 対象外 : : +| **`tf.profiler.experimental` | サポート対象 | サポート | サポート | CPU、GPU | +: start/stop [API][API_0]** : : 対象外 : 対象外 : : + **`tf.profiler.experimental` | サポート対象 | サポート対象 | サポート対象 | CPU、GPU, | +: client.trace [API][API_1]** : : : : TPU : +| **コンテキストマネージャ API** | サポート対象 | サポート | サポート | CPU、GPU | +: : : 対象外 : 対象外 : : + +[API_0]: https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2 +[API_1]: https://www.tensorflow.org/api_docs/python/tf/profiler/experimental/client/trace diff --git a/site/ja/lite/android/development.md b/site/ja/lite/android/development.md index 63717df91e..2325c745cb 100644 --- a/site/ja/lite/android/development.md +++ b/site/ja/lite/android/development.md @@ -82,21 +82,21 @@ dependencies { ### ライブラリに対応する最低 Android SDK バージョン -ライブラリ | `minSdkVersion` | デバイス要件 ---- | --- | --- -tensorflow-lite | 19 | NNAPI の使用が必要 -: : : API 27+ : | | -tensorflow-lite-gpu | 19 | GLES 3.1 または OpenCL -: : : (通常 : | | -: : : API 21+ のみで利用可 : | | -tensorflow-lite-hexagon | 19 | - -tensorflow-lite-support | 19 | - -tensorflow-lite-task-vision | 21 | android.graphics.Color -: : : 関連 API が必要 : | | -: : : API 26+ : | | -tensorflow-lite-task-text | 21 | - -tensorflow-lite-task-audio | 23 | - -tensorflow-lite-metadata | 19 | - +| ライブラリ | `minSdkVersion` | デバイス要件 | +| --------------------------- | --------------- | ---------------------- | +| tensorflow-lite | 19 | NNAPI の使用が必要 | +: : : API 27+ : +| tensorflow-lite-gpu | 19 | GLES 3.1 または OpenCL | +: : : (通常 : +: : : API 21+ のみで利用可 : +| tensorflow-lite-hexagon | 19 | - | +| tensorflow-lite-support | 19 | - | +| tensorflow-lite-task-vision | 21 | android.graphics.Color | +: : : 関連 API が必要 : +: : : API 26+ : +| tensorflow-lite-task-text | 21 | - | +| tensorflow-lite-task-audio | 23 | - | +| tensorflow-lite-metadata | 19 | - | ### Android Studio の使用 diff --git a/site/ja/lite/guide/build_arm.md b/site/ja/lite/guide/build_arm.md index 13b28c7890..780bdbc494 100644 --- a/site/ja/lite/guide/build_arm.md +++ b/site/ja/lite/guide/build_arm.md @@ -23,12 +23,12 @@ CMake プロジェクトがある場合、またはカスタムツールチェ Bazel プロジェクトがある場合、または TF 演算を使用する場合は、Bazel ビルドシステムの使用が推奨されます。ARM32/64 共有ライブラリを構築するには、統合されている [ARM GCC 8.3 ツールチェーン](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/toolchains/embedded/arm-linux)を Bazel を使用します。 -ターゲットアーキテクチャ | Bazel 構成 | 対応デバイス ---- | --- | --- -armhf(ARM32) | --config=elinux_armhf | RPI3、32ビットの RPI4 -: : : Raspberry Pi OS : | | -AArch64(ARM64) | --config=elinux_aarch64 | Coral、Ubuntu 64ビット の RPI4 -: : : bit : | | +| ターゲットアーキテクチャ | Bazel 構成 | 対応デバイス | +| ------------------------ | ----------------------- | ------------------------------ | +| armhf(ARM32) | --config=elinux_armhf | RPI3、32ビットの RPI4 | +: : : Raspberry Pi OS : +| AArch64(ARM64) | --config=elinux_aarch64 | Coral、Ubuntu 64ビット の RPI4 | +: : : bit : 注: 生成された共有ライブラリを実行するには、glibc 2.28 以降が必要です。 diff --git a/site/ja/lite/guide/build_cmake.md b/site/ja/lite/guide/build_cmake.md index b387fbb0eb..6cd3584ffb 100644 --- a/site/ja/lite/guide/build_cmake.md +++ b/site/ja/lite/guide/build_cmake.md @@ -181,19 +181,19 @@ cmake --build . -j -t label_image 使用可能なオプションは次のとおりです。`-D=[ON|OFF]` でオーバーライドできます。たとえば、`-DTFLITE_ENABLE_XNNPACK=OFF` を使用すると、既定で有効な XNNPACK が無効になります。 -オプション名 | 機能 | Android | Linux | macOS | Windows ---- | --- | --- | --- | --- | --- -`TFLITE_ENABLE_RUY` | RUY を有効にする | ON | OFF | OFF | OFF -: : matrix : : : : : | | | | | -: : multiplication : : : : : | | | | | -: : library : : : : : | | | | | -`TFLITE_ENABLE_NNAPI` | NNAPI を有効にする | ON | OFF | N/A | N/A -: : delegate : : : : : | | | | | -`TFLITE_ENABLE_GPU` | GPU を有効にする | OFF | OFF | N/A | N/A -: : delegate : : : : : | | | | | -`TFLITE_ENABLE_XNNPACK` | XNNPACK を有効にする | ON | ON | ON | ON -: : delegate : : : : : | | | | | -`TFLITE_ENABLE_MMAP` | MMAP を有効にする | ON | ON | ON | N/A +| オプション名 | 機能 | Android | Linux | macOS | Windows | +| ----------------------- | -------------------- | ------- | ----- | ----- | ------- | +| `TFLITE_ENABLE_RUY` | RUY を有効にする | ON | OFF | OFF | OFF | +: : matrix : : : : : +: : multiplication : : : : : +: : library : : : : : +| `TFLITE_ENABLE_NNAPI` | NNAPI を有効にする | ON | OFF | N/A | N/A | +: : delegate : : : : : +| `TFLITE_ENABLE_GPU` | GPU を有効にする | OFF | OFF | N/A | N/A | +: : delegate : : : : : +| `TFLITE_ENABLE_XNNPACK` | XNNPACK を有効にする | ON | ON | ON | ON | +: : delegate : : : : : +| `TFLITE_ENABLE_MMAP` | MMAP を有効にする | ON | ON | ON | N/A | ## TensorFlow Lite を使用する CMake プロジェクトの作成 diff --git a/site/ja/lite/models/convert/metadata.md b/site/ja/lite/models/convert/metadata.md index 46d016499d..b12b381043 100644 --- a/site/ja/lite/models/convert/metadata.md +++ b/site/ja/lite/models/convert/metadata.md @@ -64,58 +64,58 @@ TensorFlow Lite モデルにはさまざまな関連ファイルが含まれる 前処理と後処理の観点では、正規化と量子化は 2 つの独立したステップです。次に詳細を示します。 - | 正規化 | Quantization -:-: | --- | --- -\ | **Float モデル**: \ | **Float モデル**: \ -: An example of the : - mean: 127.5 \ : - zeroPoint: 0 \ : | | -: parameter values of the : - std: 127.5 \ : - scale: 1.0 \ : | | -: input image in : **Quant model**: \ : **Quant model**: \ : | | -: MobileNet for float and : - mean: 127.5 \ : - zeroPoint: 128.0 \ : | | -: quant models, : - std: 127.5 : - scale:0.0078125f \ : | | -: respectively. : : : | | -\ | \ | **浮動小数点数モデル** -: \ : \ : not need quantization. \ : | | -: \ : **Inputs**: If input : **Quantized model** may : | | -: \ : data is normalized in : or may not need : | | -: When to invoke? : training, the input : quantization in pre/post : | | -: : data of inference needs : processing. It depends : | | -: : to be normalized : on the datatype of : | | -: : accordingly. \ : input/output tensors. \ : | | -: : **Outputs**: output : - float tensors: no : | | -: : data will not be : quantization in pre/post : | | -: : normalized in general. : processing needed. Quant : | | -: : : op and dequant op are : | | -: : : baked into the model : | | -: : : graph. \ : | | -: : : - int8/uint8 tensors: : | | -: : : need quantization in : | | -: : : pre/post processing. : | | -\ | \ | **入力の量子化**: -: \ : \ : \ : | | -: Formula : normalized_input = : q = f / scale + : | | -: : (input - mean) / std : zeroPoint \ : | | -: : : **Dequantize for : | | -: : : outputs**: \ : | | -: : : f = (q - zeroPoint) * : | | -: : : scale : | | -\ | モデル作成者が提出 | 自動的に提出 -: Where are the : and stored in model : TFLite converter, and : | | -: parameters : metadata, as : stored in tflite model : | | -: : `NormalizationOptions` : file. : | | -How to get the | 方法 | Through the TFLite -: parameters? : `MetadataExtractor` API : `Tensor` API [1] or : | | -: : [2] : through the : | | -: : : `MetadataExtractor` API : | | -: : : [2] : | | -Do float and quant | Yes, float and quant | No, the float model does -: models share the same : models have the same : not need quantization. : | | -: value? : Normalization : : | | -: : parameters : : | | -Does TFLite Code | \ | \ -: generator or Android : Yes : Yes : | | -: Studio ML binding : : : | | -: automatically generate : : : | | -: it in data processing? : : : | | +| | 正規化 | 量子化 | +| :---------------------: | ----------------------- | ------------------------ | +| \ | **Float モデル**: \ | **Float モデル**: \ | +: An example of the : - mean\: 127.5 \ : - zeroPoint\: 0 \ : +: parameter values of the : - std\: 127.5 \ : - scale\: 1.0 \ : +: input image in : **Quant model**\: \ : **Quant model**\: \ : +: MobileNet for float and : - mean\: 127.5 \ : - zeroPoint\: 128.0 \ : +: quant models, : - std\: 127.5 : - scale\:0.0078125f \ : +: respectively. : : : +| \ | \ | **浮動小数点数モデル** | +: \ : \ : not need quantization. \ : +: \ : **Inputs**\: If input : **Quantized model** may : +: \ : data is normalized in : or may not need : +: When to invoke? : training, the input : quantization in pre/post : +: : data of inference needs : processing. It depends : +: : to be normalized : on the datatype of : +: : accordingly. \ : input/output tensors. \ : +: : **Outputs**\: output : - float tensors\: no : +: : data will not be : quantization in pre/post : +: : normalized in general. : processing needed. Quant : +: : : op and dequant op are : +: : : baked into the model : +: : : graph. \ : +: : : - int8/uint8 tensors\: : +: : : need quantization in : +: : : pre/post processing. : +| \ | \ | **入力の量子化**: | +: \ : \ : \ : +: Formula : normalized_input = : q = f / scale + : +: : (input - mean) / std : zeroPoint \ : +: : : **Dequantize for : +: : : outputs**\: \ : +: : : f = (q - zeroPoint) * : +: : : scale : +| \ | Filled by model creator | Filled automatically by +: Where are the : and stored in model : TFLite converter, and : +: parameters : metadata, as : stored in tflite model : +: : `NormalizationOptions` : file. : +| How to get the | Through the | Through the TFLite | +: parameters? : `MetadataExtractor` API : `Tensor` API [1] or : +: : [2] : through the : +: : : `MetadataExtractor` API : +: : : [2] : +| Do float and quant | Yes, float and quant | No, the float model does | +: models share the same : models have the same : not need quantization. : +: value? : Normalization : : +: : parameters : : +| Does TFLite Code | \ | \ | +: generator or Android : Yes : Yes : +: Studio ML binding : : : +: automatically generate : : : +: it in data processing? : : : [1] [TensorFlow Lite Java API](https://github.com/tensorflow/tensorflow/blob/09ec15539eece57b257ce9074918282d88523d56/tensorflow/lite/java/src/main/java/org/tensorflow/lite/Tensor.java#L73) および [TensorFlow Lite C++ API](https://github.com/tensorflow/tensorflow/blob/09ec15539eece57b257ce9074918282d88523d56/tensorflow/lite/c/common.h#L391)。
[2] [メタデータ抽出ライブラリ](../guide/codegen.md#read-the-metadata-from-models) diff --git a/site/ja/lite/performance/post_training_quantization.md b/site/ja/lite/performance/post_training_quantization.md index bf63cd7943..f8f01acc44 100644 --- a/site/ja/lite/performance/post_training_quantization.md +++ b/site/ja/lite/performance/post_training_quantization.md @@ -8,14 +8,14 @@ トレーニング後の量子化にはいくつか選択肢があります。以下は選択肢の概要の一覧表とその効果です。 -手法 | 効果 | ハードウェア ---- | --- | --- -ダイナミックレンジ | 4倍小型化、2~3倍高速化 | CPU -: 量子化 : : : | | -完全な整数 | 4倍小型化、3倍以上高速化 | CPU、Edge TPU、 -: 量子化 : : マイクロコントローラ : | | -半精度浮動小数点数の量子化 | 2倍小型化、GPU | CPU、GPU -: : アクセラレーション : : | | +| 手法 | 効果 | ハードウェア | +| -------------------------- | ------------------------ | -------------------- | +| ダイナミックレンジ | 4倍小型化、2~3倍高速化 | CPU | +: 量子化 : : : +| 完全な整数 | 4倍小型化、3倍以上高速化 | CPU、Edge TPU、 | +: 量子化 : : マイクロコントローラ : +| 半精度浮動小数点数の量子化 | 2倍小型化、GPU | CPU、GPU | +: : アクセラレーション : : この決定木は、ユースケースに最適なトレーニング後の量子化手法を選択するのに役立ちます。 diff --git a/site/ko/guide/profiler.md b/site/ko/guide/profiler.md index fb057a4d75..6ae44f5c39 100644 --- a/site/ko/guide/profiler.md +++ b/site/ko/guide/profiler.md @@ -561,7 +561,20 @@ Profiler는 4가지 축을 따라 여러 가지 사용 사례를 다룹니다. -| 프로파일링 API | 로컬 | 원격 | 다중 | 하드웨어 | : : : : 작업자 : 플랫폼 : | :--------------------------- | :-------- | :-------- | :-------- | :-------- | | **TensorBoard Keras | 지원됨 | 아님 | 아님 | CPU, GPU | : Callback** : : 지원됨 : 지원됨 : : | **`tf.profiler.experimental` | 지원됨 | 아님 | 아님 | CPU, GPU | : start/stop [API](https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2)** : : 지원됨 : 지원됨 : : | **`tf.profiler.experimental` | 지원됨 | 지원됨 | 지원됨 | CPU, GPU, | : client.trace [API](https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2)** : : : : TPU : | **Context manager API** | 지원됨 | 아님 | 아님 | CPU, GPU | : : : 지원됨 : 지원됨 : : +| 프로파일링 API | 로컬 | 원격 | 다중 | 하드웨어 | +: : : : 작업자 : 플랫폼 : +| :--------------------------- | :----- | :----- | :----- | :-------- | +| **TensorBoard Keras | 지원됨 | 아님 | 아님 | CPU, GPU | +: Callback** : : 지원됨 : 지원됨 : : +| **`tf.profiler.experimental` | 지원됨 | 아님 | 아님 | CPU, GPU | +: start/stop [API][API_0]** : : 지원됨 : 지원됨 : : +| **`tf.profiler.experimental` | 지원됨 | 지원됨 | 지원됨 | CPU, GPU, | +: client.trace [API][API_1]** : : : : TPU : +| **Context manager API** | 지원됨 | 아님 | 아님 | CPU, GPU | +: : : 지원됨 : 지원됨 : : + +[API_0]: https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2 +[API_1]: https://www.tensorflow.org/api_docs/python/tf/profiler/experimental/client/trace diff --git a/site/ko/lite/android/development.md b/site/ko/lite/android/development.md index 029d2e794b..5c048a1c97 100644 --- a/site/ko/lite/android/development.md +++ b/site/ko/lite/android/development.md @@ -82,21 +82,21 @@ dependencies { ### 라이브러리용 최소 Android SDK 버전 -라이브러리 | `minSdkVersion` | 장치 요구 사항 ---- | --- | --- -tensorflow-lite | 19 | NNAPI 사용 필요 -: : : API 27+ : | | -tensorflow-lite-gpu | 19 | GLES 3.1 또는 OpenCL -: : : (일반적으로 유일 : | | -: : : API 21+에서 사용 가능 : | | -tensorflow-lite-hexagon | 19 | - -tensorflow-lite-support | 19 | - -tensorflow-lite-task-vision | 21 | android.graphics.Color -: : : 관련 API 필요 : | | -: : : API 26+ : | | -tensorflow-lite-task-text | 21 | - -tensorflow-lite-task-audio | 23 | - -tensorflow-lite-metadata | 19 | - +| 라이브러리 | `minSdkVersion` | 장치 요구 사항 | +| --------------------------- | --------------- | ---------------------- | +| tensorflow-lite | 19 | NNAPI 사용 필요 | +: : : API 27+ : +| tensorflow-lite-gpu | 19 | GLES 3.1 또는 OpenCL | +: : : (일반적으로 유일 : +: : : API 21+에서 사용 가능 : +| tensorflow-lite-hexagon | 19 | - | +| tensorflow-lite-support | 19 | - | +| tensorflow-lite-task-vision | 21 | android.graphics.Color | +: : : 관련 API 필요 : +: : : API 26+ : +| tensorflow-lite-task-text | 21 | - | +| tensorflow-lite-task-audio | 23 | - | +| tensorflow-lite-metadata | 19 | - | ### Android Studio 사용하기 diff --git a/site/ko/lite/examples/text_classification/overview.md b/site/ko/lite/examples/text_classification/overview.md index abc5e715cc..75a768456b 100644 --- a/site/ko/lite/examples/text_classification/overview.md +++ b/site/ko/lite/examples/text_classification/overview.md @@ -71,11 +71,11 @@ Android이외의 플랫폼을 사용 중이거나 TensorFlow Lite API에 이미 ## 예제 출력 -본문 | 부정적 (0) | 긍정적 (1) ---- | --- | --- -이 영화는 내가 최근에 본 것 중 최고입니다 | 25.3 % | 74.7 % -: 년. 강력히 추천합니다! : : : | | -내 시간 낭비입니다. | 72.5 % | 27.5 % +| 본문 | 부정적 (0) | 긍정적 (1) | +| ------------------------------------------ | ---------- | ---------- | +| This is the best movie I’ve seen in recent | 25.3 % | 74.7 % | +: years. Strongly recommend it! : : : +| What a waste of my time. | 72.5 % | 27.5 % | ## 훈련 데이터세트 사용하기 diff --git a/site/ko/lite/guide/build_arm.md b/site/ko/lite/guide/build_arm.md index 8fe77d774b..53a79e3142 100644 --- a/site/ko/lite/guide/build_arm.md +++ b/site/ko/lite/guide/build_arm.md @@ -23,12 +23,12 @@ CMake 프로젝트가 있거나 사용자 정의 툴체인을 사용하려는 Bazel 프로젝트가 있거나 TF op를 사용하려는 경우, Bazel 빌드 시스템을 사용하는 것이 좋습니다. Bazel과 통합된 [ARM GCC 8.3 툴체인](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/toolchains/embedded/arm-linux)을 사용하여 ARM32/64 공유 라이브러리를 빌드합니다. -대상 아키텍처 | Bazel 구성 | 호환 기기 ---- | --- | --- -armhf (ARM32) | --config=elinux_armhf | RPI3, 32bit RPI4 -: : : Raspberry Pi OS : | | -AArch64 (ARM64) | --config=elinux_aarch64 | Coral, Ubuntu 64가 설치된 RPI4 -: : : bit : | | +| 대상 아키텍처 | Bazel 구성 | 호환 기기 | +| --------------- | ----------------------- | ------------------------------ | +| armhf (ARM32) | --config=elinux_armhf | RPI3, 32bit RPI4 | +: : : Raspberry Pi OS : +| AArch64 (ARM64) | --config=elinux_aarch64 | Coral, Ubuntu 64가 설치된 RPI4 | +: : : bit : 참고: 생성된 공유 라이브러리를 실행하려면 glibc 2.28 이상이 필요합니다. diff --git a/site/ko/lite/guide/build_cmake.md b/site/ko/lite/guide/build_cmake.md index 9c6f83e3d5..8d36e0cbc4 100644 --- a/site/ko/lite/guide/build_cmake.md +++ b/site/ko/lite/guide/build_cmake.md @@ -178,19 +178,19 @@ cmake --build . -j -t label_image 다음은 사용 가능한 옵션 목록입니다. `-D=[ON|OFF]`로 재정의 가능합니다. 예를 들어 `-DTFLITE_ENABLE_XNNPACK=OFF`는 기본적으로 활성화된 XNNPACK을 비활성화합니다. -옵션 이름 | 기능 | Android | 리눅스 | macOS | Windows ---- | --- | --- | --- | --- | --- -TFLITE_ENABLE_RUY | RUY 활성화 | ON | OFF | OFF | OFF -: : matrix : : : : : | | | | | -: : multiplication : : : : : | | | | | -: : library : : : : : | | | | | -TFLITE_ENABLE_NNAPI | NNAPI 활성화 | ON | OFF | 해당 없음 | 해당 없음 -: : delegate : : : : : | | | | | -TFLITE_ENABLE_GPU | GPU 활성화 | OFF | OFF | 해당 없음 | 해당 없음 -: : delegate : : : : : | | | | | -TFLITE_ENABLE_XNNPACK | XNNPACK 활성화 | ON | ON | ON | ON -: : delegate : : : : : | | | | | -TFLITE_ENABLE_MMAP | MMAP 활성화 | ON | ON | ON | 해당 없음 +| 옵션 이름 | 기능 | Android | 리눅스 | macOS | Windows | +| ----------------------- | -------------- | ------- | ------ | --------- | --------- | +| `TFLITE_ENABLE_RUY` | RUY 활성화 | ON | OFF | OFF | OFF | +: : matrix : : : : : +: : multiplication : : : : : +: : library : : : : : +| `TFLITE_ENABLE_NNAPI` | NNAPI 활성화 | ON | OFF | 해당 없음 | 해당 없음 | +: : delegate : : : : : +| `TFLITE_ENABLE_GPU` | GPU 활성화 | OFF | OFF | 해당 없음 | 해당 없음 | +: : delegate : : : : : +| `TFLITE_ENABLE_XNNPACK` | XNNPACK 활성화 | ON | ON | ON | ON | +: : delegate : : : : : +| `TFLITE_ENABLE_MMAP` | MMAP 활성화 | ON | ON | ON | 해당 없음 | ## TensorFlow Lite를 사용하는 CMake 프로젝트 만들기 diff --git a/site/ko/lite/performance/post_training_quantization.md b/site/ko/lite/performance/post_training_quantization.md index db83c15d9e..74e1120f2b 100644 --- a/site/ko/lite/performance/post_training_quantization.md +++ b/site/ko/lite/performance/post_training_quantization.md @@ -8,14 +8,14 @@ 선택할 수 있는 몇 가지 훈련 후 양자화 옵션이 있습니다. 다음은 선택 항목과 선택 항목이 제공하는 이점에 대한 요약표입니다. -기술 | 이점 | 하드웨어 ---- | --- | --- -동적 범위 | 4배 작아짐, 2배-3배 속도 향상 | CPU -: 양자화 : : : | | -전체 정수 | 4배 더 작게, 3배 이상의 속도 향상 | CPU, 에지 TPU -: 양자화 : : 마이크로 컨트롤러 : | | -Float16 양자화 | 2배 더 작아진 GPU | CPU, GPU -: : 가속 : : | | +| 기술 | 이점 | 하드웨어 | +| -------------- | --------------------------------- | ----------------- | +| 동적 범위 | 4배 작아짐, 2배-3배 속도 향상 | CPU | +: 양자화 : : : +| 전체 정수 | 4배 더 작게, 3배 이상의 속도 향상 | CPU, 에지 TPU | +: 양자화 : : 마이크로 컨트롤러 : +| Float16 양자화 | 2배 더 작아진 GPU | CPU, GPU | +: : 가속 : : 다음 의사 결정 트리는 사용 사례에 가장 적합한 훈련 후 양자화 메서드를 결정하는 데 도움이 될 수 있습니다. diff --git a/site/zh-cn/guide/profiler.md b/site/zh-cn/guide/profiler.md index 380201d106..127fe9515c 100644 --- a/site/zh-cn/guide/profiler.md +++ b/site/zh-cn/guide/profiler.md @@ -561,7 +561,20 @@ Profiler 在四个不同的轴上涵盖了许多用例。目前已支持部分 -| 性能剖析 API | 本地 | 远程 | 多 | 硬件 | : : : : 工作进程 : 平台 : | :--------------------------- | :-------- | :-------- | :-------- | :-------- | | **TensorBoard Keras | 支持 | 不 | 不 | CPU、GPU | : Callback** : : 支持 : 支持 : : | **`tf.profiler.experimental` | 支持 | Not | 不 | CPU、GPU | : start/stop [API](https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2)** : : 支持 : 支持 : : | **`tf.profiler.experimental` | 支持 | 支持 | 支持 | CPU、GPU、| : client.trace [API](https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2)** : : : : TPU : | **Context manager API** | 支持 | 不 | 不 | CPU、GPU | : : : 支持 : 支持 : : +| 性能剖析 API | 本地 | 远程 | 多 | 硬件 | +: : : : 工作进程 : 平台 : +| :--------------------------- | :--- | :--- | :------- | :--------- | +| **TensorBoard Keras | 支持 | 不 | 不 | CPU、GPU | +: Callback** : : 支持 : 支持 : : +| **`tf.profiler.experimental` | 支持 | 不 | 不 | CPU、GPU | +: start/stop [API][API_0]** : : 支持 : 支持 : : +| **`tf.profiler.experimental` | 支持 | 支持 | 支持 | CPU、GPU、 | +: client.trace [API][API_1]** : : : : TPU : +| **Context manager API** | 支持 | 不 | 不 | CPU、GPU | +: : : 支持 : 支持 : : + +[API_0]: https://www.tensorflow.org/api_docs/python/tf/profiler/experimental#functions_2 +[API_1]: https://www.tensorflow.org/api_docs/python/tf/profiler/experimental/client/trace diff --git a/site/zh-cn/lite/android/development.md b/site/zh-cn/lite/android/development.md index 613be36d11..1a2de80fea 100644 --- a/site/zh-cn/lite/android/development.md +++ b/site/zh-cn/lite/android/development.md @@ -82,21 +82,21 @@ dependencies { ### 用于库的最低 Android SDK 版本 -库 | `minSdkVersion` | 设备要求 ---- | --- | --- -tensorflow-lite | 19 | NNAPI 使用要求 -: : : API 27+ : | | -tensorflow-lite-gpu | 19 | GLES 3.1 或 OpenCL -: : : (通常仅) : | | -: : : 适用于 API 21+ : | | -tensorflow-lite-hexagon | 19 | - -tensorflow-lite-support | 19 | - -tensorflow-lite-task-vision | 21 | android.graphics.Color -: : : 相关 API 要求 : | | -: : : API 26+ : | | -tensorflow-lite-task-text | 21 | - -tensorflow-lite-task-audio | 23 | - -tensorflow-lite-metadata | 19 | - +| 库 | `minSdkVersion` | 设备要求 | +| --------------------------- | --------------- | ---------------------- | +| tensorflow-lite | 19 | NNAPI 使用要求 | +: : : API 27+ : +| tensorflow-lite-gpu | 19 | GLES 3.1 或 OpenCL | +: : : (通常仅 : +: : : 适用于 API 21+ : +| tensorflow-lite-hexagon | 19 | - | +| tensorflow-lite-support | 19 | - | +| tensorflow-lite-task-vision | 21 | android.graphics.Color | +: : : 相关 API 要求 : +: : : API 26+ : +| tensorflow-lite-task-text | 21 | - | +| tensorflow-lite-task-audio | 23 | - | +| tensorflow-lite-metadata | 19 | - | ### 使用 Android Studio diff --git a/site/zh-cn/lite/examples/text_classification/overview.md b/site/zh-cn/lite/examples/text_classification/overview.md index 66b9041f18..c928869a56 100644 --- a/site/zh-cn/lite/examples/text_classification/overview.md +++ b/site/zh-cn/lite/examples/text_classification/overview.md @@ -71,11 +71,11 @@ ## 示例输出 -Text | Negative (0) | Positive (1) ---- | --- | --- -This is the best movie I’ve seen in recent | 25.3% | 74.7% -: years. Strongly recommend it! : : : | | -What a waste of my time. | 72.5% | 27.5% +| 文本 | 负面 (0) | 正面 (1) | +| ------------------------------------------ | -------- | -------- | +| This is the best movie I’ve seen in recent | 25.3% | 74.7% | +: years. Strongly recommend it! : : : +| What a waste of my time. | 72.5% | 27.5% | ## 使用训练数据集 diff --git a/site/zh-cn/lite/guide/build_arm.md b/site/zh-cn/lite/guide/build_arm.md index e7630195c6..24a476008d 100644 --- a/site/zh-cn/lite/guide/build_arm.md +++ b/site/zh-cn/lite/guide/build_arm.md @@ -23,12 +23,12 @@ XNNPack | 支持 | 支持 如果您有一个 Bazel 项目,或者您想使用 TF 运算,那么您最好使用 Bazel 构建系统。您将使用集成的 [ARM GCC 8.3 工具链](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/toolchains/embedded/arm-linux)配合 Bazel 构建 ARM32/64 共享库。 -目标架构 | Bazel 配置 | 兼容设备 ---- | --- | --- -armhf (ARM32) | --config=elinux_armhf | RPI3、RPI4 运行 32 位 -: : : Raspberry Pi OS : | | -AArch64 (ARM64) | --config=elinux_aarch64 | Coral、RPI4 运行 Ubuntu 64 -: : : 位 : | | +| 目标架构 | Bazel 配置 | 兼容设备 | +| --------------- | ----------------------- | -------------------------- | +| armhf (ARM32) | --config=elinux_armhf | RPI3、RPI4 运行 32 位 | +: : : Raspberry Pi OS : +| AArch64 (ARM64) | --config=elinux_aarch64 | Coral、RPI4 运行 Ubuntu 64 | +: : : 位 : 注:生成的共享库需要 glibc 2.28 或更高版本才能运行。 diff --git a/site/zh-cn/lite/guide/build_cmake.md b/site/zh-cn/lite/guide/build_cmake.md index 83a6831ace..e0b0f9528b 100644 --- a/site/zh-cn/lite/guide/build_cmake.md +++ b/site/zh-cn/lite/guide/build_cmake.md @@ -181,19 +181,20 @@ cmake --build . -j -t label_image 以下是可用选项列表。您可以使用 `-D=[ON|OFF]` 对其进行重写。例如,通过 `-DTFLITE_ENABLE_XNNPACK=OFF` 禁用默认情况下处于启用状态的 XNNPACK。 -选项名称 | 功能 | Android | Linux | macOS | Windows ---- | --- | --- | --- | --- | --- -`TFLITE_ENABLE_RUY` | 启用 RUY | 开 | 关 | 关 | 关 -: : matrix : : : : : | | | | | -: : multiplication : : : : : | | | | | -: : library : : : : : | | | | | -`TFLITE_ENABLE_NNAPI` | 启用 NNAPI | 开 | 关 | 不适用 | 不适用 -: : 委托 : : : : : | | | | | -`TFLITE_ENABLE_GPU` | 启用 GPU | 关 | 关 | 不适用 | 不适用 -: : 委托 : : : : : | | | | | -`TFLITE_ENABLE_XNNPACK` | 启用 XNNPACK | 开 | 开 | 开 | 开 -: : 委托 : : : : : | | | | | -`TFLITE_ENABLE_MMAP` | 启用 MMAP | 开 | 开 | 开 | 不适用 +| 选项名称 | 功能 | Android | Linux | macOS | Windows | +| ----------------------- | -------------- | ------- | ----- | ------ | ------- | +| `TFLITE_ENABLE_RUY` | 启用 RUY | 开 | 关 | 关 | 关 | +: : matrix : : : : : +: : multiplication : : : : : +: : library : : : : : +| `TFLITE_ENABLE_NNAPI` | 启用 NNAPI | 开 | 关 | 不适用 | 不适用 | +: : 委托 : : : : : +| `TFLITE_ENABLE_GPU` | 启用 GPU | 关 | 关 | 不适用 | 不适用 | +: : 委托 : : : : : +| `TFLITE_ENABLE_XNNPACK` | 启用 XNNPACK | 开 | 开 | 开 | 开 | +: : 委托 : : : : : +| `TFLITE_ENABLE_MMAP` | 启用 MMAP | 开 | 开 | 开 | 不适用 | + ## 创建使用 TensorFlow Lite 的 CMake 项目 diff --git a/site/zh-cn/lite/models/convert/metadata.md b/site/zh-cn/lite/models/convert/metadata.md index 26562fe298..279c0c863e 100644 --- a/site/zh-cn/lite/models/convert/metadata.md +++ b/site/zh-cn/lite/models/convert/metadata.md @@ -64,58 +64,59 @@ TensorFlow Lite 模型可能随附不同的关联文件。例如,自然语言 就预处理和后处理而言,归一化和量化是两个独立的步骤。详情如下。 - | Normalization | Quantization -:-: | --- | --- -\ | **浮动模型**:\ | **浮动模型**:\ -: MobileNet 中分别 : - 平均:127.5 \ : - 零点:0 \ : | | -: 针对浮动模型和 : - 标准:127.5 \ : - 缩放:1.0 \ : | | -: 量化模型的 : **量化模型**: \ : **量化模型**: \ : | | -: 输入图像 : - 平均:127.5 \ : - 零点:128.0 \ : | | -: 的参数值 : - 标准:127.5 : - 缩放:0.0078125f \ : | | -: 示例。 : : : | | -\ | \ | **浮动模型** -: \ : \ : 不需要量化。\ : | | -: \ : **输入**:如果在训练中 : **量化模型**再预处理/ : | | -: \ : 对输入数据进行了 : 后处理中 : | | -: When to invoke? : 归一化,则需要对 : 可能需要量化, : | | -: : 推断的输入数据 : 也可能不需要量化。具体取决于 : | | -: : 执行相应的 : on 输入/输出张量的 : | | -: : 归一化。\ : 数据类型。\ : | | -: : **输出**:输出 : - 浮动张量:预处理/ : | | -: : 数据通常 : 后处理中不需要 : | | -: : 不进行归一化。 : 进行量化。量化 : | | -: : : 运算和去量化运算 : | | -: : : 被烘焙到模型 : | | -: : : graph. \ : | | -: : : - int8/uint8 张量: : | | -: : : 需要再预处理/后处理 : | | -: : : 中进行量化。 : | | -\ | \ | **对输入进行量化**: -: \ : \ : \ : | | -: 公式 : normalized_input = : q = f / 缩放 + : | | -: : (输入 - 平均) / 标准 : 零点 \ : | | -: : : **对输出进行 : | | -: : : outputs**: \ : | | -: : : f = (q - 零点) * : | | -: : : scale : | | -\ | 由模型创建者填充 | 由 TFLite 转换器 -: 参数位于 : 并存储在模型 : 自动填充,并 : | | -: 什么位置 : 元数据中,作为 : 存储在 tflite 模型 : | | -: : `NormalizationOptions` : 文件中。 : | | -如何获得 | 通过 | 通过 TFLite -: 参数? : `MetadataExtractor` API : `Tensor` API [1] 或 : | | -: : [2] : 通过 : | | -: : : `MetadataExtractor` API : | | -: : : [2] : | | -是,浮点和量化 | 是,浮点和量化 | 否,浮动模型 -: 模型是否共享相同的 : 模型使用相同的 : 不需要量化。 : | | -: 值? : 归一化 : : | | -: : parameters : : | | -TFLite 代码 | \ | \ -: 生成器或 Android : 是 : 是 : | | -: Studio 机器学习绑定 : : : | | -: 是否会在数据处理过程中 : : : | | -: 自动生成参数? : : : | | +| | 归一化 | 量化 | +| :--------------------: | ----------------------- | ----------------------- | +| \ | **浮点模型**:\ | **浮点模型**:\ | +: MobileNet 中分别 : - 平均:127.5 \ : - 零点:0 \ : +: 针对浮点模型和 : - 标准:127.5 \ : - 缩放:1.0 \ : +: 量化模型的 : **量化模型**:\ : **量化模型**\:\ : +: 输入图像 : - 平均:127.5 \ : - 零点:128.0 \ : +: 的参数值 : - 标准:127.5 : - 缩放:0.0078125f \ : +: 示例。 : : : +| \ | \ | **浮点模型** | +: \ : \ : 不需要量化。\ : +: \ : **输入**:如果在训练中 : **量化模型**在预处理或 : +: \ : 对输入数据进行了 : 后处理中可能需要量化, : +: When to invoke? : 归一化,则需要对 : 也可能不需要量化。 : +: : 推断的输入数据 : 具体取决于 : +: : 执行相应的 : 输入或输出张量的 : +: : 归一化。\ : 数据类型。\ : +: : **输出**:输出 : - 浮点张量:预处理或 : +: : 数据通常 : 后处理中不需要 : +: : 不进行归一化。 : 进行量化。量化 : +: : : 运算和去量化运算 : +: : : 被烘焙到模型 : +: : : graph. \ : +: : : - int8/uint8 张量: : +: : : 需要在预处理或后处理 : +: : : 中进行量化。 : +| \ | \ | **对输入进行量化**: | +: \ : \ : \ : +: 公式 : normalized_input = : q = f / 缩放 + : +: : (输入 - 平均) / 标准 : 零点 \ : +: : : **对输出进行 : +: : : 去量化**:\ : +: : : f = (q - 零点) * : +: : : 缩放 : +| \ | 由模型创建者填充 | 由 TFLite 转换器 | +: 参数位于 : 并存储在模型 : 自动填充,并 : +: 什么位置 : 元数据中,作为 : 存储在 tflite 模型 : +: : `NormalizationOptions` : 文件中。 : +| 如何获得 | 通过 | 通过 TFLite | +: 参数? : `MetadataExtractor` API : `Tensor` API [1] 或 : +: : [2] : 通过 : +: : : `MetadataExtractor` API : +: : : [2] : +| 浮点和量化 | 是,浮点和量化 | 否,浮点模型 | +: 模型是否共享相同的 : 模型使用相同的 : 不需要量化。 : +: 值? : 归一化 : : +: : 参数 : : +| TFLite 代码 | \ | \ | +: 生成器或 Android : 是 : 是 : +: Studio 机器学习绑定 : : : +: 是否会在数据处理过程中 : : : +: 自动生成参数? : : : + [1] [TensorFlow Lite Java API](https://github.com/tensorflow/tensorflow/blob/09ec15539eece57b257ce9074918282d88523d56/tensorflow/lite/java/src/main/java/org/tensorflow/lite/Tensor.java#L73) 和 [TensorFlow Lite C++ API](https://github.com/tensorflow/tensorflow/blob/09ec15539eece57b257ce9074918282d88523d56/tensorflow/lite/c/common.h#L391)。
[2] [Metadata Extractor 库](../guide/codegen.md#read-the-metadata-from-models) diff --git a/site/zh-cn/lite/performance/post_training_quantization.md b/site/zh-cn/lite/performance/post_training_quantization.md index 057b84573c..5873fa5b5d 100644 --- a/site/zh-cn/lite/performance/post_training_quantization.md +++ b/site/zh-cn/lite/performance/post_training_quantization.md @@ -8,14 +8,14 @@ 有几种训练后量化选项可供选择。下面是各种选项及其优势的汇总表: -技术 | 优势 | 硬件 ---- | --- | --- -动态范围 | 大小缩减至原来的四分之一,速度加快 2-3 倍 | CPU -: 量化 : : : | | -全整数 | 大小缩减至原来的四分之一,速度加快 3+ 倍 | CPU、Edge TPU、 -: 量化 : : 微控制器 : | | -Float16 量化 | 大小缩减至原来的二分之一,GPU | CPU、GPU -: : 加速 : : | | +| 技术 | 优势 | 硬件 | +| ------------ | ----------------------------------------- | -------------- | +| 动态范围 | 大小缩减至原来的四分之一,速度加快 2-3 倍 | CPU | +: 量化 : : : +| 全整数 | 大小缩减至原来的四分之一,速度加快 3+ 倍 | CPU、Edge TPU、| +: 量化 : : 微控制器 : +| Float16 量化 | 大小缩减至原来的二分之一,GPU | CPU、GPU | +: : 加速 : : 以下决策树可以帮助确定最适合您用例的训练后量化方法: