Python 无法使用';输入';作为输入到';合并';因为';输入';在一个while循环中。有关详细信息,请参阅信息日志

Python 无法使用';输入';作为输入到';合并';因为';输入';在一个while循环中。有关详细信息,请参阅信息日志,python,tensorflow,recurrent-neural-network,Python,Tensorflow,Recurrent Neural Network,我有一个关于Tensorflow的问题。我的部分代码是: cell2 = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons, activation=tf.nn.relu) rnn_outputs, states = tf.nn.dynamic_rnn(cell2, X, dtype=tf.float32) 它给出了以下错误: Cannot use 'Enter' as input to 'Merge' because 'Enter' is in a

我有一个关于Tensorflow的问题。我的部分代码是:

cell2 = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons, activation=tf.nn.relu)
rnn_outputs, states = tf.nn.dynamic_rnn(cell2, X, dtype=tf.float32)
它给出了以下错误:

Cannot use 'Enter' as input to 'Merge' because 'Enter' is in a while loop. See info log for more details.
如果我再次运行,我会收到类似的消息:

Cannot use 'Enter_1' as input to 'Merge_1' because 'Enter_1' is in a while loop. See info log for more details.
我想问题在于我的输入
X
X
不是一个占位符变量,我不打算给它输入一些张量,相反,它是一个大小为
[1,3,25]
的常量张量。我想做的就是得到RNN的输出(
RNN\u outputs
),并将输出与其他张量进行比较


有人能帮我解决这个问题吗?非常感谢

我仍然不能解决这个问题;但是我发现如果你断开内核,重新打开并运行程序,这个问题就会消失。