我想将输入字典转换为单个张量。可能吗?我想将ServingInputReceiver
替换为TensorServingInputReceiver
。
Tensorflow 1.10
我具有以下功能:
feature_columns = [
tf.feature_column.numeric_column(feature, shape=(1,))
for feature in feature_names
]
def json_serving_input_fn():
"""Build the serving inputs. For serving real-time predictions
using ml-engine."""
inputs = {}
for feat in feature_columns:
inputs[feat.name] = tf.placeholder(shape=[None], dtype=feat.dtype)
return tf.estimator.export.ServingInputReceiver(inputs, inputs)