【发布时间】:2016-04-01 17:17:02
【问题描述】:
我正在使用来自tensorflow.models.rnn.rnn_cell 的 MultiRNNCell。这就是我的 MultiRNNCell 的声明方式
代码:
e_cell = rnn_cell.GRUCell(self.rnn_size)
e_cell = rnn_cell.MultiRNNCell([e_cell] * 2)
稍后我从 seq2seq.embedding_rnn_decoder 内部使用它,如下所示
ouputs, mem_states = seq2seq.embedding_rnn_decoder(decoder_inputs, enc_state, e_cell, vocab_size, output_projection=(W, b), feed_previous=False)#
执行此操作时出现以下错误
错误:
tensorflow.python.framework.errors.InvalidArgumentError: Expected size[1] in [0, 0], but got 1024
[[Node: en/embedding_rnn_decoder_1/rnn_decoder/MultiRNNCell/Cell1/Slice = Slice[Index=DT_INT32, T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](Sigmoid_2, en/embedding_rnn_decoder_1/rnn_decoder/MultiRNNCell/Cell1/Slice/begin, en/embedding_rnn_decoder_1/rnn_decoder/MultiRNNCell/Cell1/Slice/size)]]
[[Node: en/embedding_rnn_decoder/rnn_decoder/loop_function_17/StopGradient/_1230 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_11541_en/embedding_rnn_decoder/rnn_decoder/loop_function_17/StopGradient", tensor_type=DT_INT64, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
有没有人看到类似的错误?有什么指点吗?
【问题讨论】:
标签: python tensorflow