SavedModelBundle.Exporter

public static final class SavedModelBundle.Exporter

Options for exporting a SavedModel.

Public Methods

void
export()
Save the model into the export directory.
SavedModelBundle.Exporter
withFunction(ConcreteFunction function)
Save a concrete function of this model.
SavedModelBundle.Exporter
withTags(String... tags)
Sets the set of tags that identify the specific graph in the saved model to save.

Inherited Methods

Public Methods

public void export ()

Save the model into the export directory.

Throws
IOException if saved model or variable state cannot be written on disk

public SavedModelBundle.Exporter withFunction (ConcreteFunction function)

Save a concrete function of this model.

The concrete function carries a signature (i.e. a list of user-friendly input and outputs names to a graph) and a valid session to a graph to be saved in the model.

Note:Eventually, TensorFlow for Java will support the export of functions objects like the Python API does but right now, only session-centric models are supported (i.e. models that has a single main graph and one or more signatures). These models are compatible with those exported by TensorFlow 1.x or by TensorFlow 2.x estimators.
Therefore, all functions exported in a model should share the same session at the moment or an exception will be thrown.

Parameters
function a function carrying a signature and a valid session to the graph to be saved
Returns
  • this object
Throws
IllegalArgumentException if a function with the same name has already been added to the model
UnsupportedOperationException if this function does not share the same session with the other functions added to this model

public SavedModelBundle.Exporter withTags (String... tags)

Sets the set of tags that identify the specific graph in the saved model to save.

Note that only one graph per model can be saved right now using this API.

Parameters
tags the tags identifying the specific MetaGraphDef to save.
Returns
  • this object
Throws
IllegalArgumentException if tags are invalid