简体   繁体   English

用文件训练的服务张量流模型

[英]Serving tensorflow model trained with files

Curious if anyone has the similar use cases as mine: 好奇是否有人拥有与我相似的用例:

My tensor flow model is trained with tfrecord files and queue runner . 我的张量流模型是使用tfrecord文件和队列运行器训练的。 As such the graph does not use placeholders. 因此,该图不使用占位符。

Now how can I save the model and service it online? 现在如何保存模型并在线维护它? As during serving, we need feed the requested data into the graph. 在投放过程中,我们需要将请求的数据输入到图表中。 If there is no placeholder, then we have no place to feed. 如果没有占位符,那么我们就没有饲料的地方。

Thanks! 谢谢!

Actually TensorFlow accept a Tensor use as a placeholder , for example: 实际上TensorFlow接受Tensor用作placeholder ,例如:

q = tf.FIFOQueue(10, dtypes=tf.int32)
a = q.dequeue()
w = tf.constant(2)
c = a * w
sess = tf.Session()
sess.run(c, feed_dict={a:1})

So the input does not have to be a placeholder when exporting model, you can make any tensor after dequeue as input for your Serving. 因此,在导出模型时,输入不必是placeholder ,出列后可以将任何张量作为Serving的输入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM