# 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()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab