Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

将该模型部署到TensorFlow Serving时如何定义Signature? #73

Open
xxxxxxxxy opened this issue Jul 26, 2019 · 0 comments
Open

Comments

@xxxxxxxxy
Copy link

更改作者保存模型的部分代码为了可以作为serving使用,但是没找到作者对于图的input和output的定义,还望作者指点迷津,感激不尽

def save_model(sess, model, path, logger):
    checkpoint_path = os.path.join(path, "1")
    #model.saver.save(sess, checkpoint_path)
    builder = tf.saved_model.builder.SavedModelBuilder(checkpoint_path)
    inputs = {}
    outputs = {}
    my_signature = tf.saved_model.signature_def_utils.build_signature_def(inputs, outputs)
    builder.add_meta_graph_and_variables(sess, [tf.saved_model.tag_constants.SERVING], signature_def_map={'my_signature': my_signature})
    builder.save()
    logger.info("model saved")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant