双向 LSTM 的 Lambda 警告

问题描述

我正在尝试实现双向 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.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)