Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow seq2seq:Tensor';对象是不可编辑的_Tensorflow_Machine Learning_Lstm_Recurrent Neural Network_Sequence To Sequence - Fatal编程技术网

Tensorflow seq2seq:Tensor';对象是不可编辑的

Tensorflow seq2seq:Tensor';对象是不可编辑的,tensorflow,machine-learning,lstm,recurrent-neural-network,sequence-to-sequence,Tensorflow,Machine Learning,Lstm,Recurrent Neural Network,Sequence To Sequence,我正在使用下面的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_in

我正在使用下面的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行。

看起来像是
seq\u input
是一个张量,而不是张量列表。单个张量适用于
tf.nn.dynamic\u rnn
,但需要将序列拆分为张量列表:

解码器输入
:2D张量列表
[批量大小x输入大小]

在中,您可以看到实现只是在
for
循环中对
解码器输入进行迭代