什么';s tensorflow中tf.contrib.rnn.BasicLSTMCell中构建函数的输入

什么';s tensorflow中tf.contrib.rnn.BasicLSTMCell中构建函数的输入,tensorflow,lstm,rnn,Tensorflow,Lstm,Rnn,我正在尝试初始化RNN单元的参数。为此,我认为我必须首先构建层。因此,我尝试使用BasicLSTMCell中的build方法构建层,但它给出了一个错误int object has no attribute value。请帮助我或给我另一种方法来初始化权重和偏差 import tensorflow as tf my_cell = tf.contrib.rnn.BasicLSTMCell(num_units = 128) # 128 is the hidden dimension which

我正在尝试初始化RNN单元的参数。为此,我认为我必须首先构建层。因此,我尝试使用BasicLSTMCell中的build方法构建层,但它给出了一个错误
int object has no attribute value
。请帮助我或给我另一种方法来初始化权重和偏差

import tensorflow as tf   
my_cell = tf.contrib.rnn.BasicLSTMCell(num_units = 128) # 128 is the hidden dimension which is a hyperparameter to be choosen by you
# Note you have just declared the LSTM cell till now, they haven't been initialized.
# Do something with the LSTM
with tf.Session as sess:
    sess.run(tf.global_variables_initializer()) # This line is necessary for the LSTM's parameters (The Matrices and Bias vectors) to be initialized