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\'
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
.