RNN Cells are not showing up when using tf.get_collection()
. What am I missing?
import tensorflow as tf
print(tf.__version__)
rnn_cell = tf.nn.rnn_cell.LSTMCell(16)
print(tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES))
other_var = tf.Variable(0)
print(tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES))
prints out
0.12.0
[]
[<tensorflow.python.ops.variables.Variable object at 0x0000027961250B70>]
Windows 10, Python 3.5
You have not run a
__call__
on theLSTMCell
which is why you don't see your variables. Try this instead (I'm assumingbatch_size=10
andrnn_size=16
)