I have trained this model:
from keras.layers import concatenate
from keras.layers import Input, Dense, Masking
from keras.models import Model
x_in = Input(shape=(5,), name='x_in')
s_in = Input(shape=(18,), name='s_in')
s_masked = Masking(0.0)(s_in)
z = concatenate([x_in,s_masked])
dense_1 = Dense(40, kernel_initializer='normal', activation='relu', name='dense_1')(z)
dense_2 = Dense(40, kernel_initializer='normal', activation='relu', name='dense_2')(dense_1)
output = Dense(1, kernel_initializer='normal', name = 'output')(dense_2)
model = Model(inputs=[x_in,s_in], outputs=output)
model.compile(optimizer='adam', loss={'output':'mean_squared_error'})
model.fit({'x_in': x_training,'s_in':s_training},{'output':y_training},batch_size=30, epochs=10, validation_split=0.3, shuffle=True, callbacks=[plot_losses])
I want now to predict now. But due to the fact that I have multiple inputs, I didnt know how to use model.predict().
When I try:
predictions = model.predict(x_testing, s_testing)
print predictions
I get this error:
The model expects 2 input arrays, but only received one array. Found: array with shape (1710, 5)
I don't understand it because I gave two arrays x_testing and s_testing