From 4f1f67f55de4ada1fb0254b6452336daa8fd3e4f Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Wed, 9 Oct 2019 12:21:34 +0200 Subject: [PATCH] Use TFLite optimizations flag Fixes #2415 --- DeepSpeech.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeepSpeech.py b/DeepSpeech.py index 871e395c..6b1d165b 100755 --- a/DeepSpeech.py +++ b/DeepSpeech.py @@ -828,7 +828,7 @@ def export(): output_tflite_path = os.path.join(FLAGS.export_dir, output_filename.replace('.pb', '.tflite')) converter = tf.lite.TFLiteConverter(frozen_graph, input_tensors=inputs.values(), output_tensors=outputs.values()) - converter.post_training_quantize = True + converter.optimizations = [ tf.lite.Optimize.DEFAULT ] # AudioSpectrogram and Mfcc ops are custom but have built-in kernels in TFLite converter.allow_custom_ops = True tflite_model = converter.convert()