Always enable TF2 in tflite_convert command line tool. If user needs to use TF1 converter then they can pass --enable_v1_converter.

Before this users needed to set environment variable TF2_BEHAVIOR=1 before invoking the tool to use v2 converter.

PiperOrigin-RevId: 348591322
Change-Id: I25baf70c2bafa56a63ac9c629ad563e26a062d86
This commit is contained in:
Karim Nosir 2020-12-22 00:25:59 -08:00 committed by TensorFlower Gardener
parent 3376c111e2
commit 02032fb477
2 changed files with 4 additions and 0 deletions
tensorflow/lite/python

View File

@ -62,6 +62,7 @@ py_binary(
visibility = ["//visibility:public"],
deps = [
":tflite_convert_main_lib",
"//tensorflow:tensorflow_py",
"@six_archive//:six",
],
)
@ -73,6 +74,7 @@ py_library(
visibility = ["//visibility:public"],
deps = [
":tflite_convert_lib",
"//tensorflow:tensorflow_py",
"@six_archive//:six",
],
)

View File

@ -26,6 +26,8 @@ import warnings
import six
from six.moves import zip
# Needed to enable TF2 by default.
import tensorflow as tf # pylint: disable=unused-import
from tensorflow.lite.python import lite
from tensorflow.lite.python.convert import register_custom_opdefs