diff --git a/tensorflow/lite/python/BUILD b/tensorflow/lite/python/BUILD index cd7ad528247..5bb0b0328ad 100644 --- a/tensorflow/lite/python/BUILD +++ b/tensorflow/lite/python/BUILD @@ -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", ], ) diff --git a/tensorflow/lite/python/tflite_convert.py b/tensorflow/lite/python/tflite_convert.py index 49275a793bc..0833e2b26c5 100644 --- a/tensorflow/lite/python/tflite_convert.py +++ b/tensorflow/lite/python/tflite_convert.py @@ -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