2017-08-15 29 views
-1

我想翻译下面tensorflow蟒蛇API来golang API如何翻译tensorflow蟒蛇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

像这样:

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)