Created
September 26, 2017 19:08
-
-
Save xiaohan2012/5456951471c6e7fd19fc796809ab303a to your computer and use it in GitHub Desktop.
tensorflow: get tensor value from checkpoint
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 | |
checkpoint_file = 'runs/deepwalk/checkpoints/model-25000' | |
sess = tf.InteractiveSession() | |
saver = tf.train.import_meta_graph("{}.meta".format(checkpoint_file)) | |
saver.restore(sess, checkpoint_file) | |
embedding_table = sess.graph.get_operation_by_name('embedding/table') | |
val = embedding_table.outputs[0].eval() | |
print(val) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment