【问题标题】:How to save a tensorflow model trained in google datalab notebook for offline prediction?如何保存在 google datalab notebook 中训练的 tensorflow 模型以进行离线预测?
【发布时间】:2018-03-03 17:42:43
【问题描述】:

我正在使用 Google Cloud Datalab 笔记本来训练我的 tensorflow 模型。我想保存经过训练的模型以进行离线预测。但是,我对如何保存模型一无所知。我应该使用任何 tensorflow 模型保存方法还是有任何数据实验室/谷歌云存储特定方法可以这样做?非常感谢这方面的任何帮助。

【问题讨论】:

    标签: tensorflow google-cloud-platform google-cloud-datalab


    【解决方案1】:

    您可以使用任何 tensorflow 模型保存方法,但我建议您将其保存到 Google Cloud Storage 存储桶而不是本地磁盘。大多数 tensorflow 方法接受 Google Cloud Storage 路径代替文件名,使用 gs:// 前缀。

    我建议使用 SavedModelBuilder,因为它目前是最便携的。这里有一个例子:https://github.com/GoogleCloudPlatform/cloudml-samples/blob/master/flowers/trainer/model.py#L393

    【讨论】:

      猜你喜欢
      • 2020-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多