Have model_to_estimator make a V2 Estimator if TF2 is enabled.

PiperOrigin-RevId: 258620905
This commit is contained in:
Thomas O'Malley 2019-07-17 12:36:22 -07:00 committed by TensorFlower Gardener
parent 18b2f26832
commit 75e3f9288e

View File

@ -103,7 +103,8 @@ def model_to_estimator(
custom_objects=custom_objects, custom_objects=custom_objects,
model_dir=model_dir, model_dir=model_dir,
config=config, config=config,
checkpoint_format=checkpoint_format) checkpoint_format=checkpoint_format,
use_v2_estimator=False)
@keras_export('keras.estimator.model_to_estimator', v1=[]) @keras_export('keras.estimator.model_to_estimator', v1=[])
@ -161,7 +162,6 @@ def model_to_estimator_v2(
custom_objects=custom_objects, custom_objects=custom_objects,
model_dir=model_dir, model_dir=model_dir,
config=config, config=config,
checkpoint_format=checkpoint_format) checkpoint_format=checkpoint_format,
use_v2_estimator=True)
# LINT.ThenChange(//tensorflow_estimator/python/estimator/keras.py) # LINT.ThenChange(//tensorflow_estimator/python/estimator/keras.py)