Relationship between tensor keeper, exporter and model conservation

Question :

he should be like that

export_dir = ... ... builder = tf.saved_model.builder.SavedModelBuilder(export_dir) with tf.Session(graph=tf.Graph()) as sess: ... builder.add_meta_graph_and_variables(sess, [tf.saved_model.tag_constants.TRAINING], signature_def_map=foo_signatures, assets_collection=foo_assets) ... with tf.Session(graph=tf.Graph()) as sess: ... builder.add_meta_graph(["bar-tag", "baz-tag"]) ... builder.save() 

So, first I need to load breakpoints with:

 saver = tf.train.import_meta_graph('model-number.meta') saver.restore(sess, tf.train.latest_checkpoint('./')) 

And then use this sess for the builder.

I'm right?

+5
source share
1 answer

SavedModel is a service format created using SavedModelBuilder. Best practice is for your tutorial code to call SavedModelBuilder and feed the resulting TF-Serving output files. If you do this, you do not need to understand the details of which files are created :)

The document [1] talks about the structure of files inside the SavedModel directory.

[1] https://www.tensorflow.org/programmers_guide/saved_model

0
source

Source: https://habr.com/ru/post/1270004/


All Articles