Error When Fitting Model in TensorFlow: logits and labels must have the same first dimension
I am new to using TensorFlow, but I am trying to build an LSTM Model using tokenized strings as inputs.
# Define the model
def build_lstm_model():
input_ids = tf.keras.layers.Input(shape=(128,), dtype=tf.int32, name='input_ids')
# BERT embedding layer
bert_model = TFBertModel.from_pretrained('bert-base-uncased')
bert_output = bert_model(input_ids)[1] # using the pooled output
# LSTM layer
lstm_output = tf.keras.layers.LSTM(64)(tf.expand_dims(bert_output,...