Skip to content

Instantly share code, notes, and snippets.

@frogermcs
Created June 4, 2019 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frogermcs/e33e4a2121a49bbaad9c0653c93f3f99 to your computer and use it in GitHub Desktop.
Save frogermcs/e33e4a2121a49bbaad9c0653c93f3f99 to your computer and use it in GitHub Desktop.
# Load TensorFlow frozen model
TF_FROZEN_MODEL = "mobilenet_v2_1.0_224_frozen.pb"
with open(TF_FROZEN_MODEL, 'rb') as f:
serialized_model = f.read()
tf.reset_default_graph()
graph_definition = tf.GraphDef()
graph_definition.ParseFromString(serialized_model)
with tf.Graph().as_default() as g:
tf.import_graph_def(graph_definition, name='')
# Learn about the model
!cat mobilenet_v2_1.0_224_info.txt
# >> Model: mobilenet_v2_1.0_224
# >> Input: input
# >> Output: MobilenetV2/Predictions/Reshape_1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment