# Load a TensorFlow Lite model

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

A TensorFlow Lite model is a FlatBuffers file that contains information on model
        operators and any associated weights and biases.

The contents of the FlatBuffers file include the following:

- Tensors (input and outputs of each op)
- Buffers (weights and biases)
- Ops that create an execution graph

The TensorFlow Lite framework provides APIs to do the following:

- Load a TensorFlow Lite model file
- Unpack all the content of the FlatBuffers file onto the memory

You can use the following API to load a TensorFlow Lite model for inference:

    #include <cstdio>
    #include <iostream>
    #include "tensorflow/lite/interpreter.h"
    #include "tensorflow/lite/kernels/register.h"
    #include "tensorflow/lite/model.h"
    #include "tensorflow/lite/optional_debug_tools.h"
      
    std::unique_ptr<tflite::FlatBufferModel> model;
    
    model = tflite::FlatBufferModel::BuildFromFile(model_name.c_str());
    if (!model) {
      std::cerr << "Failed to mmap model " << model_name << 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
Run inference](https://docs.qualcomm.com/bundle/publicresource/80-70014-54/topics/run-inference.md) [Next Topic
Create a TensorFlow Lite interpreter](https://docs.qualcomm.com/bundle/publicresource/80-70014-54/topics/create-a-tensorflow-lite-interpreter.md)