# tf.contrib.predictor.from_estimator

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/predictor/predictor_factories.py#L71-L105) |

Constructs a `Predictor` from a `tf.python.estimator.Estimator`.

    tf.contrib.predictor.from_estimator(
        estimator, serving_input_receiver_fn, output_key=None, graph=None, config=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `estimator` | an instance of `learn.python.estimator.Estimator`. |
| `serving_input_receiver_fn` | a function that takes no arguments and returns an instance of `ServingInputReceiver` compatible with `estimator`. |
| `output_key` | Optional string specifying the export output to use. If `None`, then `DEFAULT_SERVING_SIGNATURE_DEF_KEY` is used. |
| `graph` | Optional. The Tensorflow `graph` in which prediction should be done. |
| `config` | `ConfigProto` proto used to configure the session. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| An initialized `Predictor`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | if `estimator` is a contrib `Estimator` instead of a core `Estimator`. |

<br />