# tf.contrib.predictor.from_contrib_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#L29-L68) |

Constructs a `Predictor` from a [`tf.contrib.learn.Estimator`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/contrib/learn/Estimator).

    tf.contrib.predictor.from_contrib_estimator(
        estimator, prediction_input_fn, input_alternative_key=None,
        output_alternative_key=None, graph=None, config=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `estimator` | an instance of [`tf.contrib.learn.Estimator`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/contrib/learn/Estimator). |
| `prediction_input_fn` | a function that takes no arguments and returns an instance of `InputFnOps`. |
| `input_alternative_key` | Optional. Specify the input alternative used for prediction. |
| `output_alternative_key` | Specify the output alternative used for prediction. Not needed for single-headed models but required for multi-headed models. |
| `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 core `Estimator` instead of a contrib `Estimator`. |

<br />