Not being fluent in C++, I followed a few examples I found and they used auto
type. So did I.
auto model = tflite::FlatBufferModel::BuildFromFile(model_path.c_str());
This line is problematic. I assumed auto induced the type from the private variable declaration, but I guess it overrides it and is still accessible from other function calls.
Removing auto
and just calling
model = tflite::FlatBufferModel::BuildFromFile(model_path.c_str());
works as expected.