我正在尝试从github修改代码:
我收到此错误:
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 块中:
使用 tf.Session() 作为 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__() is only supported when eager execution is enabled
因此,在决定更改迭代器或启用急切执行方面的指导会很棒。
非常感谢,乔希