TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.contrib.learn.ModelFnOps

View source on GitHub

Class ModelFnOps

Ops returned from a model_fn.

THIS CLASS IS DEPRECATED. See contrib/learn/README.md for general migration instructions.

Properties

predictions

loss

train_op

eval_metric_ops

output_alternatives

training_chief_hooks

training_hooks

scaffold

mode

Methods

estimator_spec

View source

estimator_spec(default_serving_output_alternative_key=None)

Creates an equivalent EstimatorSpec.

Args:

  • default_serving_output_alternative_key: Required for multiple heads. If you have multiple entries in output_alternatives dict (comparable to multiple heads), EstimatorSpec requires a default head that will be used if a Servo request does not explicitly mention which head to infer on. Pass the key of the output alternative here that you want to designate as default. A separate ExportOutpout for this default head will be added to the export_outputs dict with the special key saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY, unless there is already an enry in output_alternatives with this special key.

Returns:

Instance of EstimatorSpec that is equivalent to this ModelFnOps

Raises:

  • ValueError: If problem type is unknown.