Description Usage Arguments Details See Also Examples
Loads a SavedModel using the given TensorFlow session and returns the model's graph.
1 | load_savedmodel(sess = NULL, model_dir = NULL)
|
sess |
The TensorFlow session. |
model_dir |
The path to the exported model, as a string. Defaults to a "savedmodel" path or the latest training run. |
Loading a model improves performance over multiple predict_savedmodel()
calls.
export_savedmodel()
, predict_savedmodel()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# start session
sess <- tensorflow::tf$Session()
# preload an existing model into a TensorFlow session
graph <- tfdeploy::load_savedmodel(
sess,
system.file("models/tensorflow-mnist", package = "tfdeploy")
)
# perform prediction based on a pre-loaded model
tfdeploy::predict_savedmodel(
list(rep(9, 784)),
graph
)
# close session
sess$close()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.