View source on GitHub |
Interpreter interface for running TensorFlow Lite models.
tf.lite.Interpreter(
model_path=None,
model_content=None,
experimental_delegates=None,
num_threads=None,
experimental_op_resolver_type=tf.lite.experimental.OpResolverType.AUTO
,
experimental_preserve_all_tensors=False,
experimental_disable_delegate_clustering=False,
experimental_default_delegate_latest_features=False
)
Used in the notebooks
Used in the guide | Used in the tutorials |
---|---|
Models obtained from TfLiteConverter
can be run in Python with
Interpreter
.
As an example, let's generate a simple Keras model and convert it to TFLite
(TfLiteConverter
also supports other input formats with from_saved_model
and from_concrete_function
)
x = np.array([[1.], [2.]])
y = np.array([[2.], [4.]])
model = tf.keras.models.Sequential([
tf.keras.layers.Dropout(0.2