graphpipe-go
graphpipe-go copied to clipboard
support tf rest api
save graph def
import tensorflow as tf
with tf.Graph().as_default() as g:
a = tf.placeholder("double", name="a", shape=[2,2])
b = tf.placeholder("double", name="b", shape=[2,2])
y = tf.multiply(a, b)
tf.train.write_graph(g, "./", "ma_plus_mb.pb", as_text=False)
run server
./graphpipe-tf --model ma_plus_mb.pb
test api
curl -d '{"a":[[1,2],[1,2]],"b":[[1,2],[1,2]]}' "http://localhost:9000/rest"