【问题标题】:Google Cloud Machine Learning API: error directory is expected to contain exactly one of: [saved_model.pb, saved_model.pbtxt]Google Cloud Machine Learning API:错误目录应包含以下项之一:[saved_model.pb, saved_model.pbtxt]
【发布时间】:2018-12-21 01:58:01
【问题描述】:

我看过这个帖子,但它没有帮助。 google cloud machine learning error

我调用 ML 引擎 API versions.create endpoint,并使用服务帐户进行身份验证,但我收到此错误
directory is expected to contain exactly one of: [saved_model.pb, saved_model.pbtxt]

deploymentUri 中引用的目录实际上只包含saved_model.pb,所以我不明白为什么会出现此错误...

我的代码:

body = {
        u"name": version_name,
        u"description": description,
        u"runtimeVersion": current_default_version.get(u"runtimeVersion"),
        u"framework": current_default_version.get(u"framework"),
        u"pythonVersion": current_default_version.get(u"pythonVersion"),
        u"deploymentUri": deployment_uri
 }
 request = ml_client.projects().models().versions().create(parent=get_query_name(model_name), body=body)
 operation = request.execute()

身体

{
    'name': 'test',
    'runtimeVersion': '1.0',
    'pythonVersion': '2.7',
    'framework': 'TENSORFLOW',
    'deploymentUri': 'gs://XXX/keras/YYY/1/export'
}

请注意:
- 我的 ML 服务帐号在 Cloud Storage 存储分区上拥有管理员权限
- 我用于服务帐户的服务帐户拥有 ML 模型的所有者权限

【问题讨论】:

    标签: google-cloud-platform google-cloud-ml


    【解决方案1】:

    您能否检查一下您的 deploymentUri 是否正确?通常,导出目录包含一个名称为时间戳的子目录

    【讨论】:

    • 不,uri 是正确的。这与我的服务帐户的存储桶权限有关。我没有找到要授予的“最佳”权限,但授予所有“读取”权限解决了问题
    • 既然你设法修复它,你能把它作为答案发布并接受它吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-20
    • 1970-01-01
    • 2020-05-21
    • 1970-01-01
    • 1970-01-01
    • 2021-05-21
    相关资源
    最近更新 更多