Inference with a model trained with tf.Dataset

爱⌒轻易说出口 提交于 2019-12-05 14:03:08

actually there is a tensor name called "IteratorGetNext:0" in the graph when you use dataset api, so you can using following way to directly set input:

#get a tensor from a graph 
input tensor : input = graph.get_tensor_by_name("IteratorGetNext:0")
# difine the target tensor you want evaluate for your prediction
prediction tensor: predictions=...
# finally call session to run 
then sess.run(predictions, feed_dict={input: np.asanyarray(images), ...})
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!