

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# TensorFlow 精简版图像分类模型存储
<a name="tensorflow-lite-image-classification-model-store-component"></a>

 TensorFlow 精简版图像分类模型存储 (`variant.TensorFlowLite.ImageClassification.ModelStore`) 是一个机器学习模型组件，其中包含一个作为 Greengrass 工件的预训练的 MobileNet v1 模型。此组件中使用的示例模型是从 [TensorFlowHub](https://tfhub.dev/) 获取的，并使用 [TensorFlow Lite](https://www.tensorflow.org/lite/guide/python) 实现。

[TensorFlow 精简版图像分类](tensorflow-lite-image-classification-component.md) 推理组件使用此组件作为模型来源的依赖关系。要使用自定义训练的 TensorFlow Lite 模型，请[创建此模型组件的自定义版本](ml-customization.md#override-public-model-store)，并将您的自定义模型作为组件构件包括在内。您可以使用此组件的配方作为模板来创建自定义模型组件。

**Topics**
+ [版本](#tensorflow-lite-image-classification-model-store-component-versions)
+ [Type](#tensorflow-lite-image-classification-model-store-component-type)
+ [操作系统](#tensorflow-lite-image-classification-model-store-component-os-support)
+ [要求](#tensorflow-lite-image-classification-model-store-component-requirements)
+ [依赖项](#tensorflow-lite-image-classification-model-store-component-dependencies)
+ [配置](#tensorflow-lite-image-classification-model-store-component-configuration)
+ [本地日志文件](#tensorflow-lite-image-classification-model-store-component-log-file)
+ [更改日志](#tensorflow-lite-image-classification-model-store-component-changelog)

## 版本
<a name="tensorflow-lite-image-classification-model-store-component-versions"></a>

此组件具有以下版本：
+ 2.1.x

## Type
<a name="tensorflow-lite-image-classification-model-store-component-type"></a>

<a name="public-component-type-generic"></a>此<a name="public-component-type-generic-phrase"></a>组件是一个通用组件 (`aws.greengrass.generic`)。[Greengrass Nucleus](greengrass-nucleus-component.md) 运行组件的生命周期脚本。

<a name="public-component-type-more-information"></a>有关更多信息，请参阅[组件类型](develop-greengrass-components.md#component-types)。

## 操作系统
<a name="tensorflow-lite-image-classification-model-store-component-os-support"></a>

此组件可以安装在运行以下操作系统的核心设备上：
+ Linux
+ Windows

## 要求
<a name="tensorflow-lite-image-classification-model-store-component-requirements"></a>

此组件具有以下要求：<a name="ml-component-requirements"></a>
+ 在运行 Amazon Linux 2 或 Ubuntu 18.04 的 Greengrass 核心设备上，[GNU C 库](https://www.gnu.org/software/libc/)（glibc）版本 2.27 或更高版本已安装在设备上。
+ 在 Armv7l 设备（例如 Raspberry Pi）上，OpenCV-Python 的依赖关系已安装在设备上。运行以下命令以安装依赖关系。

  ```
  sudo apt-get install libopenjp2-7 libilmbase23 libopenexr-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk-3-0 libwebp-dev
  ```
+ 运行 Raspberry Pi OS Bullseye 的 Raspberry Pi 设备必须满足以下要求：
  + NumPy 设备上安装了 1.22.4 或更高版本。Raspberry Pi OS Bullseye 包含的早期版本 NumPy，因此你可以运行以下命令在设备 NumPy 上进行升级。

    ```
    pip3 install --upgrade numpy
    ```
  + 旧摄像机堆栈已在设备上启用。Raspberry Pi OS Bullseye 包含一个新摄像机堆栈，该堆栈默认处于启用状态且不兼容，因此您必须启用旧摄像机堆栈。<a name="raspberry-pi-bullseye-enable-legacy-camera-stack"></a>

**启用旧摄像机堆栈**

    1. 运行以下命令以打开 Raspberry Pi 配置工具。

       ```
       sudo raspi-config
       ```

    1. 选择**接口选项**。

    1. 选择**旧摄像机**以启用旧摄像机堆栈。

    1. 重启 Raspberry Pi。

## 依赖项
<a name="tensorflow-lite-image-classification-model-store-component-dependencies"></a>

部署组件时， AWS IoT Greengrass 还会部署其依赖项的兼容版本。这意味着您必须满足组件及其所有依赖关系的要求，才能成功部署组件。本部分列出了此组件的[已发布版本](#tensorflow-lite-image-classification-model-store-component-changelog)的依赖关系，以及定义每个依赖关系的组件版本的语义版本约束。您还可以在 [AWS IoT Greengrass 控制台](https://console.aws.amazon.com//greengrass)中查看每个组件版本的依赖关系。在组件详细信息页面上，查找**依赖关系**列表。

------
#### [ 2.1.11 and 2.1.12  ]

下表列出了此组件的版本 2.1.11 和 2.1.12 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.13.0 | 软性 | 

------
#### [ 2.1.10 ]

下表列出了此组件的版本 2.1.10 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.12.0 | 软性 | 

------
#### [ 2.1.9 ]

下表列出了此组件的版本 2.1.9 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.11.0 | 软性 | 

------
#### [ 2.1.8 ]

下表列出了此组件的版本 2.1.8 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.10.0 | 软性 | 

------
#### [ 2.1.7 ]

下表列出了此组件的版本 2.1.7 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.9.0 | 软性 | 

------
#### [ 2.1.6 ]

下表列出了此组件的版本 2.1.6 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.8.0 | 软性 | 

------
#### [ 2.1.5 ]

下表列出了此组件的版本 2.1.5 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.7.0 | 软性 | 

------
#### [ 2.1.4 ]

下表列出了此组件的版本 2.1.4 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.6.0 | 软性 | 

------
#### [ 2.1.3 ]

下表列出了此组件的版本 2.1.3 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.5.0 | 软性 | 

------
#### [ 2.1.2 ]

下表列出了此组件的版本 2.1.2 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.4.0 | 软性 | 

------
#### [ 2.1.1 ]

下表列出了此组件的版本 2.1.1 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.3.0 | 软性 | 

------
#### [ 2.1.0 ]

下表列出了此组件版本 2.1.0 的依赖关系。


| 依赖关系 | 兼容版本 | 依赖关系类型 | 
| --- | --- | --- | 
| [Greengrass Nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.2.0 | 软性 | 

------

## 配置
<a name="tensorflow-lite-image-classification-model-store-component-configuration"></a>

此组件没有任何配置参数。

## 本地日志文件
<a name="tensorflow-lite-image-classification-model-store-component-log-file"></a>

此组件不输出日志。

## 更改日志
<a name="tensorflow-lite-image-classification-model-store-component-changelog"></a>

下表介绍每个组件版本的更改。


|  版本  |  更改  | 
| --- | --- | 
|  2.1.12  |  对 Greengrass Nucleus 版本 2.12.5 发行版进行了版本更新。  | 
|  2.1.11  | 版本更新为 Greengrass Nucleus 版本 2.12.0 发布版。 | 
|  2.1.10  | 版本更新为 Greengrass Nucleus 版本 2.11.0 发布版。 | 
|  2.1.9  | 版本更新为 Greengrass Nucleus 版本 2.10.0 发布版。 | 
|  2.1.8  | 对 Greengrass Nucleus版本 2.9.0 发行版进行了版本更新。 | 
|  2.1.7  | 版本更新为 Greengrass Nucleus 版本 2.8.0 发布版。 | 
|  2.1.6  |  版本更新为 Greengrass Nucleus 版本 2.7.0 发布版。  | 
|  2.1.5  |  版本更新为 Greengrass Nucleus 版本 2.6.0 发布版。  | 
|  2.1.4  |  版本更新为 Greengrass Nucleus 版本 2.5.0 发布版。  | 
|  2.1.3  |  版本更新为 Greengrass Nucleus 版本 2.4.0 发布版。  | 
|  2.1.2  |  版本更新为 Greengrass Nucleus 版本 2.3.0 发布版。  | 
|  2.1.1  |  对 Greengrass Nucleus 版本 2.2.0 发行版进行了版本更新。  | 
|  2.1.0  |  初始版本。  | 