Last active
October 5, 2019 09:14
-
-
Save joelbarmettlerUZH/136039479700d9beafd7bdf5ee316f53 to your computer and use it in GitHub Desktop.
Load 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
import tensorflow as tf | |
def open_graph(): | |
detection_graph = tf.Graph() | |
with detection_graph.as_default(): | |
od_graph_def = tf.GraphDef() | |
with tf.gfile.GFile('ssd_mobilenet_v1_coco_2017_11_17/frozen_inference_graph.pb', 'rb') as fid: | |
serialized_graph = fid.read() | |
od_graph_def.ParseFromString(serialized_graph) | |
tf.import_graph_def(od_graph_def, name='') | |
return detection_graph |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment