model = tf.keras.Sequential([tf.keras.layers.Embedding(tokenizer.vocab_size, 64),tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(64,return_sequences=True))
我正在尝试运行一个序列模型,但是无法得到适合于训练模型的形状。每个输入是一个包含500个值的数组,每个输出也是一个500个值的数组。,其值为500个,如上面所示的输出数组。但是,无论我尝试什么形状,我都会得到如下错误:
ValueError: Input 0 of layer "lstm" is incompatible with the layer: expectedFull shape rec
我需要预测一个数字序列的k值。为此,我决定使用斐波那契数列mod 15,并为每个要预测的值(n+1,n+2,...n+k)建立一个模型。一切都很好,除了这一点:当我使用特征测试集预测值时,模型给出了错误的形状。我希望形状是(20,1),但我得到的是(20,200,1)。你能帮帮我吗?import metricsfrom tensorflow import keras
from tensorflow.<e