public class SavedModelBundle extends Object implements AutoCloseable
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).
Modifier and Type | Class and Description |
---|---|
static class |
SavedModelBundle.Loader
Options for loading a SavedModel.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
|
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 |
session()
Returns the
Session with which to perform computation using the model. |
public static SavedModelBundle load(String exportDir, String... tags)
This method is a shorthand for:
SavedModelBundle.loader().withTags(tags).load();
exportDir
- the directory path containing a saved model.tags
- the tags identifying the specific metagraphdef to load.public static SavedModelBundle.Loader loader(String exportDir)
Loader
object that can set configuration options before actually
loading the model,exportDir
- the directory path containing a saved model.public byte[] metaGraphDef()
public Graph graph()
public Session session()
Session
with which to perform computation using the model.public void close()
close
in interface AutoCloseable
Copyright © 2022. All rights reserved.