This message was deleted.
# ask-for-help
s
This message was deleted.
c
Hi @Paul Roopson Pradeep, could you also share your Keras model definition code, especially the
predict
method?
Or sample code of how do you use the predict method without the runner?
p
sorry for the late response: Here is the model definition:
Copy code
InputA = Input(shape=(108,))
InputB = Input(shape=(6,))

x = Dense(16,activation="relu")(InputA)
x_model = Model(inputs=InputA, outputs=x)


y = Embedding(input_dim=len(vocab), output_dim=16, input_length=6)(InputB)
y = Flatten()(y)
y_model = Model(inputs=InputB, outputs=y)

combined = concatenate([x_model.output, y_model.output])

z = Dense(16, activation='relu')(combined)
z = Dense(1, activation='linear')(z)
model = Model(inputs=[x_model.input, y_model.input], outputs=z)

model.compile(loss='mse', optimizer='adam', metrics=['mae'])
and here is the predict call:
pred = model.predict([x_test,a_x_test])
And here are the shapes of
x_test
and
a_x_test
x_test
: (323270, 108)
a_x_test
: (323270, 6)
This works fine. when i tried to package is as a bentoml model and run the prediction with the same test inputs, it doesnt work
c
did you enable batching or specify the batch dim when saving the model with BentoML?
p
Here is how i am saving the model:
bentoml.keras.save_model("embedding_price_model", model)
is there anything else i should be passing in?
c
Are you using Tensorflow 1.x or 2.0+?
cc @Jiang @larme (shenyang)
p
tensorflow 2
specifically 2.13.0-rc1
j
@Paul Roopson Pradeep Hi. Just try
price_predictions = runner.predict.run(input_a, input_b)
p
ah cool let me try this