Created
March 6, 2017 23:01
-
-
Save mrubash1/49ff0bc33c5ef63a960f473d2d21ef43 to your computer and use it in GitHub Desktop.
Create and persist a TensorFlow Graph
This file contains 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
def create_and_persist_graph(): | |
with tf.Session() as persisted_sess: | |
# Load Graph | |
with tf.gfile.FastGFile(modelFullPath,’rb’) as f: | |
graph_def = tf.GraphDef() | |
graph_def.ParseFromString(f.read()) | |
persisted_sess.graph.as_default() | |
tf.import_graph_def(graph_def, name=’’) | |
return persisted_sess.graph |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment