[英]How do I save a model instead of a checkpoint?
I was following this tutorial, but when I wanted to convert the.h5 file into.pb I found out that I can't use checkpoints.我正在关注本教程,但是当我想将 .h5 文件转换为 .pb 时,我发现我不能使用检查点。
https://www.thepythoncode.com/article/skin-cancer-detection-using-tensorflow-in-python https://www.thepythoncode.com/article/skin-cancer-detection-using-tensorflow-in-python
Please explain this to me请给我解释一下
Use model.save() to save the model in.pb format.使用 model.save() 将 model 保存为 .pb 格式。 For more information read Tensorflow SavedModel format .有关更多信息,请阅读Tensorflow SavedModel 格式。
import tensorflow as tf
#Load .h5 saved model
pre_model = tf.keras.models.load_model("final_model.h5")
#Converts .pb format
pre_model.save("saved_model/my_model")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.