0

我正在尝试实现双向 LSTM,但收到以下警告。我不完全确定这意味着什么。我的模型是否仍会按照我的预期从传递给 LSTM 的输入中学习?

这是我的代码的一部分:

#First Layers
input=tf.keras.Input(shape=(n_timesteps,n_features),batch_size=batch_size,name='Input')

x1=Bidirectional(LSTM(units=32,dropout=drout,return_sequences=True),name='LSTM_1')(input)

WARNING:tensorflow:
The following Variables were used a Lambda layer's call (tf.keras.backend.rnn_58), but
are not present in its tracked objects:
  <tf.Variable 'LSTM_1/forward_lstm/lstm_cell_1/kernel:0' shape=(20, 128) dtype=float32>
  <tf.Variable 'LSTM_1/forward_lstm/lstm_cell_1/recurrent_kernel:0' shape=(32, 128) dtype=float32>
  <tf.Variable 'LSTM_1/forward_lstm/lstm_cell_1/bias:0' shape=(128,) dtype=float32>
It is possible that this is intended behavior, but it is more likely
an omission. This is a strong indication that this layer should be
formulated as a subclassed Layer rather than a Lambda layer.
4

0 回答 0