Reputation: 71
These are codes I used through Python to try neural networks to find the predicted revenue based on these predictors. When I tried to fit the model, I got the following error:
ValueError: Exception encountered when calling Sequential.call().
Input 0 of layer "dense_2" is incompatible with the layer: expected axis -1 of input shape to have value 3, but received input with shape (None, 14)
Arguments received by Sequential.call():
• inputs=tf.Tensor(shape=(None, 14), dtype=float32)
• training=True
• mask=None
I already knew that the problem that needs to be resolved is to reshape the NumPy array to a 2 dimensional array or add a second dimension to the data. I tried the functions .reshape(-1,1)
and np.expand_dims
but nothing seems to be working
UPDATE: Changed the input_dim to 14. I have received the following error:
ValueError: Could not interpret loss identifier: mean squared error
Upvotes: -1
Views: 43
Reputation: 11
The error occurs because your input layer expects an input dimension of 3, but your dataset has 14 features. Review it.
Upvotes: 1