【发布时间】:2017-06-19 00:25:41
【问题描述】:
我正在尝试使用 tensorflow 服务来提供重新训练的初始图。对于再培训,我使用的是example。但是我需要对此图表进行更改以使其与serving export code 一起使用。
由于在 tensorflow 服务中,您将收到序列化的图像作为输入,图形输入应以此开头:
serialized_tf_example = tf.placeholder(tf.string, name='tf_example')
feature_configs = {
'image/encoded': tf.FixedLenFeature(shape=[], dtype=tf.string),
}
tf_example = tf.parse_example(serialized_tf_example, feature_configs)
jpegs = tf_example['image/encoded']
images = tf.map_fn(preprocess_image, jpegs, dtype=tf.float32)
此图像张量应输入到重新训练的初始图。但是我不知道是否可以在 tensorflow 中将一个图附加到另一个图上,就像您可以使用 placeholder_with_input 轻松附加一样(这已在重新训练代码中完成)。
graph, bottleneck_tensor, jpeg_data_tensor, resized_image_tensor = (
create_inception_graph())
理想情况下,在图像再训练代码中,我会收到一个占位符张量 jpeg_input_data。我需要将张量 images 附加到这个占位符张量 jpeg_data_tensor 并使用导出器将其导出为单个图,以便可以使用 tensorflow 服务对其进行服务。但是我没有任何 tensorflow 指令可以做到这一点。除了这个方法还有其他的选择吗?
【问题讨论】:
标签: tensorflow tensorflow-serving