SavedModelBundle represents a model loaded from storage.
The model consists of a description of the computation (a Graph
), a Session
with tensors (e.g., parameters or variables in the graph) initialized to values saved in storage, and a description of the model (a serialized representation of a MetaGraphDef protocol buffer).
Nested Classes
class | SavedModelBundle.Loader | Options for loading a SavedModel. |
Public Methods
void | |
Graph | graph() Returns the graph that describes the computation performed by the model. |
static SavedModelBundle | load(String exportDir, String... tags) Load a saved model from an export directory. |
static SavedModelBundle.Loader | loader(String exportDir) Load a saved model. |
byte[] | metaGraphDef() Returns the serialized MetaGraphDef protocol buffer associated with the saved model. |
Session |
Inherited Methods
Public Methods
public void close ()
public static SavedModelBundle load (String exportDir, String... tags)
Load a saved model from an export directory. The model that is being loaded should be created using the Saved Model API.
This method is a shorthand for:
SavedModelBundle.loader().withTags(tags).load();
Parameters
exportDir | the directory path containing a saved model. |
---|---|
tags | the tags identifying the specific metagraphdef to load. |
Returns
- a bundle containing the graph and associated session.
public static SavedModelBundle.Loader loader (String exportDir)
Load a saved model.
Returns aLoader
object that can set configuration options before actually loading the model,Parameters
exportDir | the directory path containing a saved model. |
---|
public byte[] metaGraphDef ()
Returns the serialized MetaGraphDef protocol buffer associated with the saved model.