1

我收到此错误并且无法修复它:

~.conda\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py in iter (self)
394 if context.in_graph_mode():
395 raise TypeError(
396 "Tensor当急切执行时对象不可迭代未
启用“ 397”。要迭代此张量,请使用tf.map_fn.")
398 shape = self._shape_tuple()

TypeError:Tensor当未启用急切执行时,对象不可迭代。迭代这个张量使用tf.map_fn

我的代码是:

START = tf.placeholder(tf.float32, shape=[None,1, img_size, img_size, 
num_filters1], name='START')
decoder_inputs = tf.map_fn(lambda x: x, START)
decoder_1_outputs_state = tf.contrib.legacy_seq2seq.rnn_decoder(
    decoder_inputs, encoder_1_final_state, decoder_1_rnn_cell, loop_fn)
4

0 回答 0