Tensorflow convert_to_tensor TypeError: List of Tensors when single Tensor expected
<p>I am getting the following error when executing the code below. rnn.rnn() returns a list of tensors. Error is on the convert_to_tensor line.</p>

<blockquote>
  <p>TypeError: List of Tensors when single Tensor expected</p>
</blockquote>

<pre><code>outputs, _states = rnn.rnn(lstm, X_split, initial_state=init_state)
output_tensor = tf.convert_to_tensor(outputs)
</code></pre>

<p>When I also initialized the dtype argument to tf.float32</p>

<pre><code>output_tensor = tf.convert_to_tensor(outputs, dtype=tf.float32)
</code></pre>

<p>I got the following error on the same line:</p>

<blockquote>
  <p>TypeError: Expected float32, got list containing Tensors of type '_Message' instead.</p>
</blockquote>

<p>What is the cause of these errors? I want my final output to be a tensor containing tensors.</p>

<p>EDIT: I checked the DType of the individual tensors of the list. All of them are of type float32. What could be the cause of this error now?</p>