模型目录应包含'export.meta'文件

时间:2016-11-12 15:28:27

标签: google-cloud-ml

在选择存储桶和文件夹后为模型创建新版本期间,我从云控制台收到此错误。

{
    "error": {
    "code": 400,
    "message": "Field: version.deployment_uri Error: The model directory gs://ml-codelab/v1-output/ is expected to contain the 'export.meta' file. Please make sure it exists and Cloud ML service account cloud-ml-service@xxx.iam.gserviceaccount.com has read access to it",
    "status": "FAILED_PRECONDITION",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
        "field": "version.deployment_uri",
        "description": "The model directory gs://ml-codelab/v1-output/ is expected to contain the 'export.meta' file. Please make sure it exists and Cloud ML service account cloud-ml-service@xxxx.iam.gserviceaccount.com has read access to it"
          }
        ]
      }
    ]
    }
}

1 个答案:

答案 0 :(得分:1)

导出模型时需要创建元图。您可以使用保护程序来执行此操作,例如

saver = tf.train.Saver()
saver.save(sess, os.path.join(FLAGS.output_dir, "export"))

通常,您可以单独保存会话和图表,因为您的服务图表可能与培训图表不同。