# 概述

Source: [https://docs.qualcomm.com/doc/80-70017-54SC/topic/tflite-landing-page.html](https://docs.qualcomm.com/doc/80-70017-54SC/topic/tflite-landing-page.html)

Lite Runtime (LiteRT) 是一个专为设备端推理而设计的开源深度学习框架。TensorFlow 框架提供了工具和 API，用于将标准的预训练 TensorFlow 模型从 SavedModel 或 Keras 格式转换为 LiteRT 格式。

本指南介绍了使用 Qualcomm^®^ 软件堆栈执行 LiteRT 模型的可用 delegate 和方法，并说明了如何：

- 使用基于 Gstreamer 的 Qualcomm^®^ Intelligent Multimedia SDK (IM SDK) 或本机 LiteRT 应用程序运行 LiteRT 模型。
- 将 TensorFlow 模型转换为 LiteRT 模型并针对设备上推理进行优化。
- 使用硬件加速器（例如 CPU、GPU 和 Qualcomm^®^ Hexagon™ 张量处理器）上的 delegate 执行 LiteRT 模型。
- 对 LiteRT 模型进行基准测试。

运行 LiteRT 模型

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-1 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [使用基于 Gstreamer 的 IM SDK](https://docs.qualcomm.com/doc/80-70017-54SC/topic/getting-started.html#run-a-tensorflow-lite-model-using-the-gstreamer-based-qim-sdk)

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-4 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [使用本机 LiteRT 示例应用程序](https://docs.qualcomm.com/doc/80-70017-54SC/topic/getting-started.html#run-a-tensorflow-lite-model-using-a-native-tensorflow-lite-sample-application)

LiteRT 开发者工作流程

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-2 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [将 TensorFlow 模型转换为 LiteRT 模型](https://docs.qualcomm.com/doc/80-70017-54SC/topic/tensorflow-lite-developer-workflow.html#convert-tensorflow-lite-models)

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-5 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [创建应用程序并运行推理](https://docs.qualcomm.com/doc/80-70017-54SC/topic/tensorflow-lite-developer-workflow.html#run-inference)

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-7 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [开发定制的应用程序](https://docs.qualcomm.com/doc/80-70017-54SC/topic/tensorflow-lite-developer-workflow.html#develop-a-custom-application-to-run-the-tensorflow-lite-model)

示例程序

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-3 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [下载模型和示例图像](https://docs.qualcomm.com/doc/80-70017-54SC/topic/sample-applications.html#download-models-and-sample-images)

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-6 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [使用可用的代理运行 LiteRT 模型](https://docs.qualcomm.com/doc/80-70017-54SC/topic/sample-applications.html#label-image-tool)

<?xml version="1.0" encoding="UTF-8"?>

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="21" height="18" viewbox="0 0 21 18">
  <defs>
    <style>.svg-8 .cls-1 { fill: none; stroke: #3253dc; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5px }</style>
  </defs>
  <path class="cls-1" d="M4.7,9.4h11.7M16.4,9.4l-5.8-5.8M16.4,9.4l-5.8,5.8"></path>
</svg>
 [使用外部 delegate 运行 QNN delegate](https://docs.qualcomm.com/doc/80-70017-54SC/topic/sample-applications.html#run-qnn-delegate-using-the-external-delegate-interface)

注释： 参见 Qualcomm^®^ Linux^®^ 支持的[硬件 SoC](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-115/soc.html)。

Last Published: Jan 24, 2025

[Next Topic
入门](https://docs.qualcomm.com/bundle/publicresource/80-70017-54SC/topics/getting-started.md)