![]() |
Constructs a Predictor
from a SavedModel
on disk.
tf.contrib.predictor.from_saved_model(
export_dir,
signature_def_key=None,
signature_def=None,
input_names=None,
output_names=None,
tags=None,
graph=None,
config=None
)
Args:
export_dir
: a path to a directory containing aSavedModel
.signature_def_key
: Optional string specifying the signature to use. IfNone
, thenDEFAULT_SERVING_SIGNATURE_DEF_KEY
is used. Only one ofsignature_def_key
andsignature_def
signature_def
: ASignatureDef
proto specifying the inputs and outputs for prediction. Only one ofsignature_def_key
andsignature_def
should be specified. input_names: A dictionary mapping strings toTensor
s in theSavedModel
that represent the input. The keys can be any string of the user's choosing. output_names: A dictionary mapping strings toTensor
s in theSavedModel
that represent the output. The keys can be any string of the user's choosing.tags
: Optional. Tags that will be used to retrieve the correctSignatureDef
. Defaults toDEFAULT_TAGS
.graph
: Optional. The Tensorflowgraph
in which prediction should be done.config
:ConfigProto
proto used to configure the session.
Returns:
An initialized Predictor
.
Raises:
ValueError
: More than one ofsignature_def_key
andsignature_def
is specified.