This repository was archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
TfLite Survey
qingqing01 edited this page Nov 22, 2017
·
28 revisions
-
Architecture Introduction
-
What is the relationship between TensorFlow and TfLite?
There is no relationship between TensorFlow and TfLite. TfLite is another lightweight inference framework.
The simple usage is as follows:
// 1. Load Model
tflite::FlatBufferModel model(path_to_model);
// 2. Init and Build Interpreter
tflite::ops::builtin::BuiltinOpResolver resolver;
std::unique_ptr<tflite::Interpreter> interpreter;
tflite::InterpreterBuilder(*model, resolver)(&interpreter);
// 3. Resize input tensors, if desired.
// Allocate Tensors and fill `input`.
interpreter->AllocateTensors();
float* input = interpreter->typed_input_tensor<float>(0);
// 4. Inference
interpreter->Invoke();
// 5. Read the output
float* output = interpreter->type_output_tensor<float>(0);- BuiltinOpResolver: The regular usage will require the developer to use the BuiltinOpResolver, which has many operators.
- Operator pruning: Users can rewrite other OpResolver to prun the operators.