Created
January 8, 2018 10:35
-
-
Save plutov/e0b0afbdfde3261232fa8af90008f849 to your computer and use it in GitHub Desktop.
tensorflow5.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a session for inference over modelGraph. | |
session, err := tf.NewSession(modelGraph, nil) | |
if err != nil { | |
log.Fatalf("could not init session: %v", err) | |
} | |
defer session.Close() | |
output, err := session.Run( | |
map[tf.Output]*tf.Tensor{ | |
modelGraph.Operation("input").Output(0): tensor, | |
}, | |
[]tf.Output{ | |
modelGraph.Operation("output").Output(0), | |
}, | |
nil) | |
if err != nil { | |
log.Fatalf("could not run inference: %v", err) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment