Skip to content

Instantly share code, notes, and snippets.

@avloss
Created March 10, 2017 17:37
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 avloss/a9ce59962b516e8b7348c724a70b8491 to your computer and use it in GitHub Desktop.
Save avloss/a9ce59962b516e8b7348c724a70b8491 to your computer and use it in GitHub Desktop.
from tensorflow.contrib.session_bundle import exporter

saver = tf.train.Saver(sharded=True)
model_exporter = exporter.Exporter(saver)
model_exporter.init(
    sess.graph.as_graph_def(),
    named_graph_signatures={
        'inputs': exporter.generic_signature({'x': x}),
        'outputs': exporter.generic_signature({'pred': pred})})
model_exporter.export(EXPORT_PATH, tf.constant(VERSION), sess)
INFO:tensorflow:/tmp/models/00000001-tmp/export is not in all_model_checkpoint_paths. Manually adding it.
'/tmp/models/00000001'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment