graphpipe-go icon indicating copy to clipboard operation
graphpipe-go copied to clipboard

support tf rest api

Open ggaaooppeenngg opened this issue 6 years ago • 0 comments

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"

ggaaooppeenngg avatar Apr 04 '19 09:04 ggaaooppeenngg