0

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

{
    "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"
          }
        ]
      }
    ]
    }
}
4

1 回答 1

1

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

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

通常,您会分别保存会话和图表,因为您的服务图表可能与训练图表不同。

于 2016-11-12T18:01:55.420 回答