Valueerror: Error When Checking : Expected Dense_1_input To Have Shape (3,) But Got Array With Shape (1,)
I am trying to predict using the learned .h5 file. The learning model is as follows. model =Sequential() model.add(Dense(12, input_dim=3, activation='relu')) model.add(Dense(8, act
Solution 1:
The shape of x is obviously
(3,1)
, but the above error continues.
You are right, but that's not what keras expects. It expects (1, 3)
shape: by convention, axis 0 denotes the batch size and axis 1 denotes the features. The first Dense
layer accepts 3 features, that's why it complains when it sees just one.
The solution is simply to transpose x
.
Post a Comment for "Valueerror: Error When Checking : Expected Dense_1_input To Have Shape (3,) But Got Array With Shape (1,)"