如何将tensorflow python API转换为golang API

时间:2017-08-15 10:10:07

标签: tensorflow

我想在tensorflow python API下面翻译golang API

softmax_tensor = sess.graph.get_tensor_by_name('final_result:0')
predictions = sess.run(softmax_tensor, {'DecodeJpeg/contents:0': image_data})

有人知道吗,谢谢!

1 个答案:

答案 0 :(得分:1)

像这样:

output, err := session.Run(
    map[tf.Output]*tf.Tensor{
        graph.Operation("DecodeJpeg/contents").Output(0): tensor,
    }, []tf.Output{
        graph.Operation("final_result").Output(0),
    },
    nil)