1

I have been studying the book "Tensor flow for Dummies" and there is a piece of code to restore variables earlier stored

with tf.Session() as sess:

# Load stored graph into current graph
saver = tf.train.import_meta_graph('output.meta')

# Restore variables into graph
saver.restore(sess, os.getcwd() + '/output')

# Display value of variable
print('Variable value: ', sess.run('x_result:0'))

Here the variable was defined with the text name as 'x_result' however in the last line we are calling the variable by 'x_result:0' what is the ':0' for. Further when I remove the ':0' I dont get the required result. Please help me understand what all purposes does the ':0' serve

  • I am not sure whether you found the answer to your question. I just thought of sharing a solution which addresses your question. [See here](https://stackoverflow.com/questions/36150834/how-does-tensorflow-name-tensors) – pythonic_autometeor May 03 '20 at 16:52

0 Answers0