I tried to run a simple program to save a Tensorflow session to disk as "spikes.cpkt". Although the system output in the interactive program showed that I successfully created this file, I can not find this file in the file system.
As a version of Tensorflow, I use 0.11rc using Python 2. The operating system is Ubuntu 16.04. The program was written and launched on Jupiter's laptop.
The following is the source code for saving a session:
import tensorflow as tf
sess = tf.InteractiveSession()
raw_data = [1., 2., 8., -1., 0., 5.5, 6., 13.]
spikes = tf.Variable([False] * len(raw_data), name='spikes')
spikes.initializer.run()
saver = tf.train.Saver()
for i in range(1, len(raw_data)):
if raw_data[i] - raw_data[i-1] > 5:
spikes_val = spikes.eval()
spikes_val[i] = True
updater = tf.assign(spikes, spikes_val)
updater.eval()
save_path = saver.save(sess, "spikes.ckpt")
print("spikes data saved in file: %s" % save_path)
sess.close()
The system output is shown in figure (1):

Files created in the File system are shown in the figure (2):

There is no file on the disk named "spikes.ckpt".
source
share