I noticed that on subsequent launches of the Tensorflow script, your Ops graph gets numbered names, for example:
loss = tf.reduce_mean(tf.nn.l2_loss(y - pred), name="l2_loss")
will get the names:
l2_loss
l2_loss_1
l2_loss_2
...
l2_loss_N
as you continue to do the same sweeps in the same IPython session. This would not be so offensive, except that later in the scripts, when you want to save the summary:
x_sample, y_sample = get_sample(X, Y)
feed = {x: x_batch, y: y_batch}
trainer.run(feed_dict=feed)
summary_str = summary_op.eval(feed_dict=feed)
You will receive the following failure:
InvalidArgumentError: You must feed a value for placeholder tensor 'x_input' with dtype float ....
Is there a way (at the top of the script or something else) to remove all these old, obsolete definitions of Op and use the current run and correctly obey the imperative name=...when creating variables, placeholders and constants?
source
share