Skip to content

Instantly share code, notes, and snippets.

@campoy
Created April 4, 2018 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save campoy/0ec529c9b7da21138ae949dcc6b00701 to your computer and use it in GitHub Desktop.
Save campoy/0ec529c9b7da21138ae949dcc6b00701 to your computer and use it in GitHub Desktop.
modelBytes, _ := assets.Asset("model.pb")
graph := tf.NewGraph()
graph.Import(modelBytes, "")
input := graph.Operation("input").Output(0)
output := graph.Operation("output").Output(0)
sess, _ := tf.NewSession(graph, &tf.SessionOptions{})
feed, _ := tf.NewTensor([][]float32{})
result, _ := sess.Run(
map[tf.Output]*tf.Tensor{input: input1},
[]tf.Output{output}, nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment