'Keras model.fit, dimensions must be equal?

I am a newbie in ML. I have a set of timeseries data with Date and Temp cols., that I want to use for anomaly detection. I used the MinMax scaler on the data and I got an array normal_train_data with shape (200, 0). Then I used the autoencoder which uses

keras.layers.Dense(128, activation ='sigmoid'). 

After that, when I call

history = model.fit(normal_train_data, normal_train_data, epochs= 50, batch_size=128, validation_data=(train_data_scaled[:,1:], train_data_scaled[:,1:]) ...) 

I get the error:

ValueaError: Dimensions must be equal but are 128 and 0 with input shapes: [?,128], [?,0].

As far as I understand the input has shape (200,0) and the output(1,128). Can you help me to fix this error please? Thankyou

I tried to use tf.keras.layers.Flatten() in the encoder part. I am not sure if it's ok to use Dense layer or should I choose another.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source