Skip to content

Instantly share code, notes, and snippets.

View NHZlX's full-sized avatar
🏠
Working from home

Zhaolong Xing NHZlX

🏠
Working from home
View GitHub Profile
@Ouwen
Ouwen / tensorflow_pbtxt_graph_load.py
Created July 25, 2018 18:16
Load a tensorflow graph from a .pbtxt
import tensorflow as tf
from google.protobuf import text_format
# Let's read our pbtxt file into a Graph protobuf
f = open("/tmp/storage/graph_protobuf.pbtxt", "r")
graph_protobuf = text_format.Parse(f.read(), tf.GraphDef())
# Import the graph protobuf into our new graph.
graph_clone = tf.Graph()
with graph_clone.as_default():