Created
March 27, 2017 13:27
-
-
Save solaris33/43612034adcece85ff2430bb2fc68627 to your computer and use it in GitHub Desktop.
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
model_fn = 'tensorflow_inception_graph.pb' | |
# creating TensorFlow session and loading the model | |
graph = tf.Graph() | |
sess = tf.InteractiveSession(graph=graph) | |
with tf.gfile.FastGFile(model_fn, 'rb') as f: | |
graph_def = tf.GraphDef() | |
graph_def.ParseFromString(f.read()) | |
t_input = tf.placeholder(np.float32, name='input') # define the input tensor | |
imagenet_mean = 117.0 | |
t_preprocessed = tf.expand_dims(t_input-imagenet_mean, 0) | |
tf.import_graph_def(graph_def, {'input':t_preprocessed}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment