From 7db477e1a120be72e9fccce062361e4e3984a99c Mon Sep 17 00:00:00 2001 From: Nupur Garg Date: Thu, 28 Feb 2019 10:32:18 -0800 Subject: [PATCH] Throw error for using tflite_convert with the command line. PiperOrigin-RevId: 236148909 --- tensorflow/lite/python/tflite_convert.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tensorflow/lite/python/tflite_convert.py b/tensorflow/lite/python/tflite_convert.py index 401a592273c..ad4b04c4f3e 100644 --- a/tensorflow/lite/python/tflite_convert.py +++ b/tensorflow/lite/python/tflite_convert.py @@ -25,6 +25,7 @@ import sys from tensorflow.lite.python import lite from tensorflow.lite.python import lite_constants from tensorflow.lite.toco import toco_flags_pb2 as _toco_flags_pb2 +from tensorflow.python import tf2 from tensorflow.python.platform import app @@ -258,6 +259,11 @@ def _check_flags(flags, unparsed): def run_main(_): """Main in toco_convert.py.""" + if tf2.enabled(): + raise ValueError("tflite_convert is currently unsupported in 2.0. " + "Please use the Python API " + "tf.lite.TFLiteConverter.from_concrete_function().") + parser = argparse.ArgumentParser( description=("Command line tool to run TensorFlow Lite Optimizing " "Converter (TOCO)."))