Hi everyone, I want to ask a question. I have buil...
# ask-for-help
p
Hi everyone, I want to ask a question. I have build a simple DNN model and the input is concatenate input. I can successfully perform inference using
model.predict(input_dict)
. Below is the inference data, it's a dictionary that contain the feature name and the tensor:
Copy code
input_dict = {
  "feature_1": <tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], dtype=int32)>,
  "feature_2": <tf.Tensor: shape=(1,), dtype=float32, numpy=array([18.181818], dtype=float32)>,
  ...
  "feature_33": <tf.Tensor: shape=(1,), dtype=int32, numpy=array([15], dtype=int32)>
}
Then I save the model, create runner, and run:
Copy code
bentoml.keras.save_model(
    name="embedding_dnn",
    model=model,
    signatures={"predict": {"batchable": True, "batch_dim": 0}},
)
runner = bentoml.keras.get("embedding_dnn:latest").to_runner()
runner.init_local()
runner.run(input_dict)
But unfortunately, I got error
ValueError: Attempt to convert a value ({'feature_1': <tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], ..., 'feature_33': <tf.Tensor: shape=(1,), dtype=int32, numpy=array([15], dtype=int32)>}) with an unsupported type (<class 'dict'>) to a Tensor.
Can someone help me? Is there any part that I am missing when saving the model or elsewhere?