how to load and use a saved model on tensorflow?

后端 未结 4 1517
无人及你
无人及你 2021-01-31 19:22

I have found 2 ways to save a model in Tensorflow: tf.train.Saver() and SavedModelBuilder. However, I can\'t find documentation on using the mo

4条回答
  •  长发绾君心
    2021-01-31 20:12

    Tensorflow's preferred way of building and using a model in different languages is tensorflow serving

    Now in your case, you are using saver.save to save the model. This way it saves a meta file, ckpt file and some other files to save the weights and network information, steps trained etc. This is the preferred way of saving while you are training.

    If you are done with training now you should freeze the graph using SavedModelBuilder from the files you save by saver.save. This frozen graph contains a pb file and contains all the network and weights.

    This frozen model should be used to serve by tensorflow serving and then other languages can use the model using gRPC protocol.

    The whole procedure is described in this excellent tutorial.

提交回复
热议问题