[英]SavedModel file does not exist at: model.h5/{saved_model.pbtxt|saved_model.pb}
Tensorflow Version 2.0 Tried in Colab as Well as local Tensorflow 2.0 版已在 Colab 和本地试用
Ubuntu 18.4 Ubuntu 18.4
model.h5 is in current working directry model.h5 在当前工作目录中
import tensorflow as tf
export_dir='model.h5'
converter = tf.lite.TFLiteConverter.from_saved_model(export_dir)
tflite_model = converter.convert()
Output输出
SavedModel file does not exist at: model.h5/{saved_model.pbtxt|saved_model.pb}
Since it is a keras model, you have to load it using tf.lite.TFLiteConverter.from_keras_model(export_dir)
instead of from_saved_model
.由于它是 keras 模型,因此您必须使用tf.lite.TFLiteConverter.from_keras_model(export_dir)
而不是from_saved_model
加载它。 As written here .如这里所写。
Also, make sure, the file is accessible via your defined path export_dir
.此外,请确保该文件可通过您定义的路径export_dir
访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.