Я пытаюсь использовать следующий json_serving_fn для прогнозирования в моей модели tf.
def json_serving_input_fn():
"""Build the serving inputs."""
feature_placeholders = {'a': tf.placeholder(shape=[None], dtype='string'),
'b': tf.placeholder(shape=[None], dtype='string'),
'c': tf.placeholder(shape=[1,10], dtype='string')}
return tf.estimator.export.ServingInputReceiver(
features=feature_placeholders,
receiver_tensors=feature_placeholders)
Процессы обучения и оценки завершаются, как предполагалось (и ортогональны проблеме), но моя функция обслуживания завершается ошибкой со следующим кодом ошибки:
INFO:tensorflow:Signatures EXCLUDED from export because they cannot be be served via TensorFlow Serving APIs:
INFO:tensorflow:'serving_default' : Classification input must be a single string Tensor; got {'symptoms': <tf.Tensor 'Placeholder_2:0' shape=(1,10) dtype=string>, 'age': <tf.Tensor 'Placeholder_1:0' shape=(?,) dtype=string>, 'sex': <tf.Tensor 'Placeholder:0' shape=(?,) dtype=string>}
Я намереваюсь пройтиследующий json для прогноза:
{"a":"x","b":"y","c":["p1","p2","","","","","","","",""]}
Как мне переписать мой json_serving_input_fun для достижения этой цели?