tf.contrib.predictor.from_estimator(
estimator,
serving_input_receiver_fn,
output_key=None,
graph=None,
config=None
)
Defined in tensorflow/contrib/predictor/predictor_factories.py
.
Constructs a Predictor
from a tf.python.estimator.Estimator
.
Args:
estimator
: an instance oflearn.python.estimator.Estimator
.serving_input_receiver_fn
: a function that takes no arguments and returns an instance ofServingInputReceiver
compatible withestimator
.output_key
: Optional string specifying the export output to use. IfNone
, thenDEFAULT_SERVING_SIGNATURE_DEF_KEY
is used.graph
: Optional. The Tensorflowgraph
in which prediction should be done.config
:ConfigProto
proto used to configure the session.
Returns:
An initialized Predictor
.
Raises:
TypeError
: ifestimator
is a contribEstimator
instead of a coreEstimator
.