简体   繁体   中英

what the differences between tf.train.Saver().restore() and tf.saved_model.loader

I'd like to know the differences between tf.train.Saver().restore() and tf.saved_model.loader() .

As far as I know, tf.train.Saver().restore() restores the previously saved variables from the checkpoint file; and tf.saved_model.loader() loads the graph def from the pb file.

But I have no idea about when I should choose restore() or loader() ?

During training, restoring from checkpoints, etc, you want to use the saver. You only want to use the saved model if you're loading your exported model for inference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM