ValueError: Input 0 of layer sequential is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (57, 1)

I am working with the LSTM model and getting this error.

ValueError: Input 0 of layer sequential is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (57, 1)

Here is my code:

model = tf.keras.Sequential()
model.add(tf.keras.layers.LSTM(64, input_shape = (700, 57), return_sequences=True))
model.add(tf.keras.layers.LSTM(64))
model.add(tf.keras.layers.Dense(64, activation='relu'))
model.add(tf.keras.layers.Dense(10, activation='softmax'))

optimizer = tf.keras.optimizers.Adam(lr=0.001)

model.compile(optimizer=optimizer,
             loss='sparse_categorical_crossentropy',
             metrics=['accuracy'])

model.summary()
history = model.fit(train_data, batch_size=32, epochs=60, verbose=2, validation_data=valid_data)
model.save("LSTM.h5")

The shape of my training data is:

input_shape = (x_train.shape, y_train.shape)
print(input_shape)

((700, 57), (700,))

The training dataset contains 700 rows (samples) and 57 columns (features) and the test dataset contains labels for 700 samples.

LSTM expects inputs a 3D tensor, with shape [batch, timesteps, feature]

1.You need to define input_shape = (1,57)

model.add(tf.keras.layers.LSTM(64, input_shape = (1, 57), return_sequences=True))

2.Reshape x_train as (700, 1, 57) by expanding the dimension

x_train = x_train[:, None, :]

3.What is your train_data and valid_data?