Created
May 11, 2020 06:04
-
-
Save Mistobaan/cc85464a1d32742581d97ba215f150e5 to your computer and use it in GitHub Desktop.
TPU tricks
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
from google.cloud import storage | |
from tensorflow import MetaGraphDef | |
client = storage.Client() | |
bucket = client.get_bucket(Config.MODEL_BUCKET) | |
blob = bucket.get_blob('model.ckpt.meta') | |
model_graph = blob.download_as_string() | |
mgd = MetaGraphDef() | |
mgd.ParseFromString(model_graph) | |
with tf.Session() as sess: | |
saver = tf.train.import_meta_graph(mgd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment