![](/img/trans.png)
[英]SavedModel file does not exist at: model.h5/{saved_model.pbtxt|saved_model.pb}
[英]Convert a Tensorflow model in SavedModel format (.pb file) saved with tf.saved_model.save to a Keras model (.h5 file)
I'm trying to convert a Tensorflow object detection model that's saved in a SavedModel format (in a folder with .pb
file, assets
folder, and variables
folder) to Keras.h5 for simpler inference. 但是,尝试对此问题的常见 StackOverflow 答案(例如this )会导致ValueError: Unable to create a Keras model from this SavedModel. This SavedModel was created with tf.saved_model.save, and lacks the Keras metadata.Please save your Keras model by calling model.save or tf.keras.models.save_model.
ValueError: Unable to create a Keras model from this SavedModel. This SavedModel was created with tf.saved_model.save, and lacks the Keras metadata.Please save your Keras model by calling model.save or tf.keras.models.save_model.
.
model 使用 Tensorflow Object 检测 ZDB974238714CA8A1434A7CE1D08 进行训练和保存。 是否仍然可以将其转换为 Keras model? 如果是这样,有什么建议吗?
在将 YoloV5 转换为 Tensorflow 格式以部署 model 时,我遇到了同样的问题。 您需要在 model 的导出命令中使用keras=True
。 这将在目录中生成 Keras_metadata.pb 文件。
[https://www.tensorflow.org/api_docs/python/tf/keras/models/save_model][1]
[1]:请参考此链接添加上述命令以保存 Tensorflow model。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.