存储桶上的云 ML 引擎读取访问权限

cloud ml engine read access on bucket

我正在尝试使用我的 nodejs 应用引擎项目启动 Cloud ML-Engine 作业。 由于没有它的库,我正在使用 "googleapis" 这样的:

const {google} = require('googleapis');
const params = {
    parent: 'projects/my-playground',
    requestBody: {
        jobId: 'test-job-' + Date.now(),
        trainingInput: {
            runtimeVersion: '1.6',
            jobDir: 'gs://my-ml-test-bucket',
            packageUris: ['gs://my-ml-test-bucket/MLEngine/trainer'],
            pythonModule: 'trainer.task',

            scaleTier: "CUSTOM",
            masterType: "complex_model_l",
            workerCount: "0",
            workerType: "standard",
            parameterServerCount: "0",
            parameterServerType: "standard",
            region: "europe-west1",

            args: [
                'file=gs://my-ml-test-bucket/testFile.csv',
                'threshold=0.5',
                'latent-factors=15',
                'iterations=50'
            ]
        }
    }
};
google.auth.getClient()
    .then(authClient => {
        const ML = google.ml({
            version: 'v1',
            auth: authClient
        });
        ML.projects.jobs.create(params)
    });

执行代码时,出现以下错误:

Error creating the job. Field: package_uris Error: The provided GCS paths [gs://my-ml-test-bucket/MLEngine/trainer] cannot be read. Please make sure that the objects exist and you have read access to it.

所有文件都上传到此目录,Cloud ML Service Agent 获得了存储桶的 Storage Object Admin 权限,但我仍然收到此错误。 有什么想法吗?

您似乎在 trainingInputpackageUris 参数中指定了目录名称。如果您已将培训师代码上传到 Cloud Storage,则应将完整路径传递给压缩存档文件。

比如你的训练包叫trainer.tar.gz,你可以传入下面的值:packageUris: ['gs://my-ml-test-bucket/MLEngine/trainer.tar.gz'].

以下 link 提供了有关在 Cloud ML Engine 上创建和使用包的附加信息:https://cloud.google.com/ml-engine/docs/tensorflow/packaging-trainer