在 Keras 中,您可以使用以下方法加载您之前训练过的模型:
训练好的_keras_model = tf.keras.models.load_model(model_name)
有没有使用 TensorFlow estimator API 的等效方法?根据文档,我必须使用:
trained_estimator = tf.estimator.Estimator (model_fn,model_dir) 我想只使用模型目录中的文件来获得训练有素的估计器。更清楚地说,我的想法是在没有 model_fn 源代码的情况下从磁盘加载“任何”模型。有可能这样做吗?
这个功能是在 Keras 中实现的,所以我不明白为什么 Estimator API 不能做到这一点。