# Create a TensorFlow Lite interpreter

Source: [https://docs.qualcomm.com/doc/80-70014-54/topic/create-a-tensorflow-lite-interpreter.html](https://docs.qualcomm.com/doc/80-70014-54/topic/create-a-tensorflow-lite-interpreter.html)

Using the TensorFlow C/C++ APIs, you can build an interpreter to run the
        model.

The interpreter interface allows you to do the following:

- Configure model execution on a chosen delegate.
- Allocate the memory needed to perform forward propagation.

The following example code demonstrates how you can create an interpreter. You can
            configure the interpreter instance to use a specific delegate and perform forward
            propagation.

    //Build the interpreter with the InterpreterBuilder.
    //Note: all Interpreters should be built with the InterpreterBuilder,
    // which allocates memory for the Interpreter and does various set up
    // tasks so that the Interpreter can read the provided model.
      
    tflite::ops::builtin::BuiltinOpResolver resolver;
    tflite::InterpreterBuilder builder(*model, resolver);
    std::unique_ptr<tflite::Interpreter> interpreter;
    builder(&interpreter);
    if (!interpreter) {
       std::cerr << “Failed to construct interpreter on provided tflite model” << std::endl;
    }
    if (interpreter->AllocateTensors() != kTfLiteOk) {
       std::cerr <<  "Failed to allocate tensors!" << std::endl;
       exit(-1);
    }
    Copy to clipboard

**Parent Topic:** [Run inference](https://docs.qualcomm.com/doc/80-70014-54/topic/run-inference.html)

Last Published: Jul 12, 2024

[Previous Topic
Load a TensorFlow Lite model](https://docs.qualcomm.com/bundle/publicresource/80-70014-54/topics/load-a-tensorflow-lite-model.md) [Next Topic
Prepare a model with a chosen delegate](https://docs.qualcomm.com/bundle/publicresource/80-70014-54/topics/prepare-a-model-with-a-chosen-delegate.md)