Basically I'm trying to build a model that uses embedded words as the input, but I keep getting this warning. I've tried to change the shape of the input according to the training data for my model various times but it does not have any effect on the model building. I'm trying to predict temperature values for my input, a range from 0 - 100
During training, the loss scores some times change and other times they do not,. I'm not really sure what is going on here.
Raw Shape of the Data:
x_train shape: (17405, 3840)
y_train shape: (17405,)
x_valid shape: (4352, 3840)
y_valid shape: (4352,)
Building the Model
# Initializing the ANN
model = Sequential()
# Adding the input layer and the first hidden layer
model.add(Dense(units=1, activation='relu', input_shape = x_train.shape))
# Adding the second hidden layer
model.add(Dense(units=1, activation='relu'))
# Adding the output layer
model.add(Dense(units=1, activation='linear'))
Compiling and Training
#Global Variables for Model
optimizer = tf.keras.optimizers.Adam(learning_rate=0.0001) #methods used to change the attributes of the nn
# tf.keras.optimizers.SGD(learning_rate=0.001)
batch_size = 100 # Defines the number of samples that will be propagated through the network.
loss = 'mean_squared_error' #Cmpute the quantity that a model should seek to minimize during training
EPOCHS = 20 # How many times to go through the training set.
# Compiling the Model
model.compile(optimizer = optimizer, loss = loss, metrics=['mae'])
# Training/Fitting the Model on the Training set
model.fit(x_train, y_train, batch_size = batch_size,
epochs = EPOCHS, verbose = 1)
#Model Summary
model.summary()
#Model Evaluation
score = model.evaluate(x_valid, y_valid, verbose=1)
As mentioned, the model runs but I get the following error:
WARNING:tensorflow:Model was constructed with shape (None, 17405, 3840) for input Tensor("dense_73_input:0", shape=(None, 17405, 3840), dtype=float32), but it was called on an input with incompatible shape (None, 3840).