【发布时间】:2016-09-01 09:13:34
【问题描述】:
我在这里使用简单的教程代码https://www.oreilly.com/learning/hello-tensorflow
这是我的版本:
import tensorflow as tf
x = tf.constant(1.0, name='input')
w = tf.Variable(0.8, name='weight')
y = tf.mul(w, x, name='output')
y_ = tf.constant(0.0, name='correct_value')
loss = tf.pow(y - y_, 2, name='loss')
train_step = tf.train.GradientDescentOptimizer(0.025).minimize(loss)
summary_y = tf.scalar_summary('output', loss)
sess = tf.Session()
sess.run(tf.initialize_all_variables())
summary_writer = tf.train.SummaryWriter('outs')
for i in range(1000):
summary_writer.add_summary(sess.run(summary_y), i)
sess.run(train_step)
之后,我在张量板上只有 1000 步中的 914 步。这是一个检查:
tensorboard --inspect --logdir=outs
======================================================================
Processing event files... (this can take a few minutes)
======================================================================
Found event files in:
outs
These tags are in outs:
audio -
histograms -
images -
scalars
output
======================================================================
Event statistics for outs:
audio -
graph -
histograms -
images -
scalars
first_step 0
last_step 913
max_step 913
min_step 0
num_steps 914
outoforder_steps []
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
======================================================================
如果我打开张量板,我会看到 914 步(从 0 到 913)的正确图。 无论步数如何,都会发生这种情况。例如,如果我走了 100 步,那么总结起来只保存了 93 步。
我正在使用 Fedora 23 (4.6.5-200.fc23.x86_64 GNU/Linux)。 Tensorflow 是虚拟环境中最新的全新安装
pip list | grep tensorflow
tensorflow (0.10.0rc0)
有什么想法在最后一次迭代中丢失了吗?
【问题讨论】: