LSTM
专业混水
这个作者很懒,什么都没留下…
展开
-
TypeError: The following are legacy tf.layers.Layers: <tensorflow.python.keras.layers.legacy_rnn.r
在tensorflow2中使用tf.conpat.v1.nn.rnn_cell.BasicLSTMCell()出现错误: TypeError: The following are legacy tf.layers.Layers: To use keras as a framework (for instance using the Network, Model, or Sequential classes), please use the tf.keras.layers implementation原创 2021-03-04 12:38:22 · 1163 阅读 · 1 评论 -
怎么在Input层后加一个LSTM层
在使用keras的Input来定义网络的输入层后,想要加一个LSTM层,总是出现各种各样的错误,解决方法如下: import tensorflow as tf from tensorflow.keras.layers import Input #想要输入的数据 inputs = np.random.random([32,8]).astype(np.float32) #输入数据的特征个数 num_features=inputs.shape[1] #定义输入层 input_layer = Input(shape原创 2021-03-04 12:31:12 · 402 阅读 · 1 评论