I've been struggling in the last 1-2 days with how to build TensorFlow Lite so I can use it as headers or library in my own C\C++ project.
For example, I have a C++ project with main.cpp with the following code:
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/kernels/register.h"
int main()
{
std::unique_ptr<tflite::FlatBufferModel> model;
model = tflite::FlatBufferModel::BuildFromBuffer(h5_converted_tflite, h5_converted_tflite_len);
tflite::ops::builtin::BuiltinOpResolver resolver;
std::unique_ptr<tflite::Interpreter> interpreter;
tflite::InterpreterBuilder(*model, resolver)(&interpreter);
// Resize input tensors, if desired.
interpreter->AllocateTensors();
float* input = interpreter->typed_input_tensor<float>(0);
// Fill `input`.
interpreter->Invoke();
float* output = interpreter->typed_output_tensor<float>(0);
}
What should I download\build, and from where, so I can successfully compile this code? Currently it says, obviously, that the h files cannot be found, and when I clone the TF repository and add it to the include folders, it doesn't find "flatbuffers.h" file, and when I add it manually, it gives me many linkage errors. Any help will be appreciated here...
Thanks in advance