我正在尝试修改来自github的代码:
我遇到了以下错误:
此外,我认为我需要急切执行的原因是在我的 with tf.session 代码块中:
我遇到了以下错误:
tf.enable_eager_execution must be called at program startup.
我认为问题出在这些代码行:
from __future__ import print_function
import make_dataset
import tensorflow as tf
import tensorflow.contrib.eager as tfe
tf.enable_eager_execution()
此外,我认为我需要急切执行的原因是在我的 with tf.session 代码块中:
with tf.Session() as sess:
# Run the initializer
sess.run(iterator.initializer)
for step in range(1, num_steps+1):
batch_x, batch_y = myDataset.batch(4)#line where error occurs
# Run optimization op (backprop)
sess.run(train_op, feed_dict={X: batch_x, Y: batch_y})
我遇到了错误:
RuntimeError: dataset.__iter__() 仅在启用 eager execution 时支持
所以,在决定更改迭代器或启用 eager execution 方面的指导将是很好的。
非常感谢, Josh