【发布时间】:2016-12-20 21:20:06
【问题描述】:
使用tf.get_collection() 时,RNN 单元不显示。我错过了什么?
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))
打印出来
0.12.0
[]
[<tensorflow.python.ops.variables.Variable object at 0x0000027961250B70>]
Windows 10、Python 3.5
【问题讨论】:
-
你需要
__call__LSTMCell来创建它的变量
标签: python tensorflow recurrent-neural-network