Tensorflow转换为单个Tensor ServingInputReceiver与TensorServingInputReceiver

时间:2018-10-16 07:33:28

标签: tensorflow

我想将输入字典转换为单个张量。可能吗?我想将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)

0 个答案:

没有答案