【发布时间】:2017-09-28 16:32:31
【问题描述】:
我正在尝试导出类似的张量流模型
feature_spec = { 'words': tf.FixedLenSequenceFeature([], tf.int64, allow_missing=True) }
def serving_input_receiver_fn():
"""Build the serving inputs."""
serialized_tf_example = tf.placeholder(dtype=tf.string,
shape=[1],
name='input_example_tensor')
features = tf.parse_example(serialized_tf_example, feature_spec)
receiver_tensors = {'words': serialized_tf_example}
return tf.estimator.export.ServingInputReceiver(features, receiver_tensors)
export_dir = classifier.export_savedmodel(export_dir_base=args.job_dir,
serving_input_receiver_fn=serving_input_receiver_fn)
但我收到此错误
Cannot infer num from shape (1, ?, 128, 128)
我不知道? 来自哪里,我猜它来自tf.parse_example。关于我在这里做错了什么有什么想法吗?
【问题讨论】:
标签: python machine-learning tensorflow google-cloud-ml-engine