简体   繁体   English

tf.train.Saver()。restore()和tf.saved_model.loader之间有什么区别

[英]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() . 我想知道tf.train.Saver().restore()tf.saved_model.loader()之间的区别。

As far as I know, tf.train.Saver().restore() restores the previously saved variables from the checkpoint file; 据我所知, tf.train.Saver().restore()checkpoint文件恢复以前保存的变量; and tf.saved_model.loader() loads the graph def from the pb file. tf.saved_model.loader()pb文件加载图形def。

But I have no idea about when I should choose restore() or loader() ? 但我不知道何时应该选择restore()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. 如果要加载导出的模型以进行推理,则只需要使用已保存的模型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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