diff options
author | 2018-08-02 15:47:43 -0700 | |
---|---|---|
committer | 2018-08-02 15:51:17 -0700 | |
commit | 1bf206bc82f600886f1e19c9860f09f18984346b (patch) | |
tree | fbd6ee10df16e491142017e96120181b81a72ec5 /tensorflow/contrib/predictor | |
parent | 6fbbad97e293cc39bde32495e92614c69a9a7896 (diff) |
Split checkpoint management utility functions out of saver.py
Pure refactor, in preparation for adding a higher level checkpoint management utility. This utility will also need to work with the Checkpoint proto, and globbing it on to saver.py seems dirty.
PiperOrigin-RevId: 207179646
Diffstat (limited to 'tensorflow/contrib/predictor')
-rw-r--r-- | tensorflow/contrib/predictor/contrib_estimator_predictor.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/contrib/predictor/contrib_estimator_predictor.py b/tensorflow/contrib/predictor/contrib_estimator_predictor.py index af3b2ad1b5..c2166594e5 100644 --- a/tensorflow/contrib/predictor/contrib_estimator_predictor.py +++ b/tensorflow/contrib/predictor/contrib_estimator_predictor.py @@ -22,8 +22,8 @@ from __future__ import print_function from tensorflow.contrib.learn.python.learn.utils import saved_model_export_utils from tensorflow.contrib.predictor import predictor from tensorflow.python.framework import ops +from tensorflow.python.training import checkpoint_management from tensorflow.python.training import monitored_session -from tensorflow.python.training import saver class ContribEstimatorPredictor(predictor.Predictor): @@ -57,7 +57,8 @@ class ContribEstimatorPredictor(predictor.Predictor): # pylint: disable=protected-access model_fn_ops = estimator._get_predict_ops(input_fn_ops.features) # pylint: enable=protected-access - checkpoint_path = saver.latest_checkpoint(estimator.model_dir) + checkpoint_path = checkpoint_management.latest_checkpoint( + estimator.model_dir) self._session = monitored_session.MonitoredSession( session_creator=monitored_session.ChiefSessionCreator( config=config, |