# 运行模型

Source: [https://docs.qualcomm.com/doc/80-70014-54Y/topic/execute-a-model.html](https://docs.qualcomm.com/doc/80-70014-54Y/topic/execute-a-model.html)

要运行推理，使用 `Invoke()` API 调用 delegate。在调用此 API 之前，创建适当的输入和输出缓冲区并将它们提供给解析器。

推理完成后，可对解析器输出缓存进行解析以获取推理结果。

使用 delegate 执行模型的 `Invoke()` API 的示例如下：

    // Run Inference 
    interpreter->Invoke()
    Copy to clipboard

推理完成后，从 TensorFlow Lite `Invoke()` API 输出的张量存在于解析器的输出缓冲区中。

            要对这些输出进行进一步的后处理，可从解析器中对其进行解析。

有关端到端示例，参见 [TensorFlow GitHub 存储库](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/examples/label_image)中的 label\_image 示例。

有关详细信息，参见 [TensorFlow Lite 指南](https://www.tensorflow.org/lite/guide)。

**Parent Topic:** [运行推理](https://docs.qualcomm.com/doc/80-70014-54Y/topic/run-inference.html)

Last Published: Aug 06, 2024

[Previous Topic
准备输入/输出缓冲区](https://docs.qualcomm.com/bundle/publicresource/80-70014-54Y/topics/prepare-input-output-buffers.md) [Next Topic
开发定制应用程序来运行 TensorFlow Lite 模型](https://docs.qualcomm.com/bundle/publicresource/80-70014-54Y/topics/develop-a-custom-application-to-run-the-tensorflow-lite-model.md)