我在代码下面使用seq2seq,我发现下面的错误:
cell = tf.nn.rnn_cell.BasicLSTMCell(size)
a, b = tf.nn.dynamic_rnn(cell, seq_input, dtype=tf.float32)
cell_a = tf.contrib.rnn.OutputProjectionWrapper(cell, frame_dim)
dec_output= tf.contrib.legacy_seq2seq.rnn_decoder(seq_input, b, cell_a)但我知道错误是:
TypeError: 'Tensor' object is not iterable.我查过了,它来自seq2seq线。
发布于 2018-02-22 21:02:46
看起来seq_input是张量,而不是张量列表。单个张量对于tf.nn.dynamic_rnn很好,但是rnn_decoder需要将序列分解为张量列表:
decoder_inputs:2D张量的列表[batch_size x input_size]。
在源代码中,您可以看到实现只是在for循环中在decoder_inputs上迭代。
https://stackoverflow.com/questions/48936180
复制相似问题