TFSavedModel¶
- class verta.utils.TFSavedModel(saved_model_dir, session=None)¶
Wrapper around a TensorFlow SavedModel for compatibility with Verta deployment.
- Parameters:
saved_model_dir (str) – Directory containing a SavedModel.
session (
tf.Session
, optional) – Session to load the SavedModel into. This parameter is for using the model locally; the session will be handled automatically during deployment.
Warning
This utility is deprecated in favor of the simpler and more flexible class-as-model setup. See the Client repository for an example.
- predict(**kwargs)¶
- Parameters:
**kwargs – Values for input tensors.
- Returns:
dict of string to
np.array
– Map of output names to values.
Examples
tf_saved_model.predict(x=[1], y=[2]) # {'x_plus_y': array([3], dtype=int32)}