- gcloud alpha ai-platform local train - run an AI Platform training job locally
(ALPHA)This command runs the specified module in an environment similar to that of a live AI Platform Training Job.
This is especially useful in the case of testing distributed models, as it allows you to validate that you are properly interacting with the AI Platform cluster configuration. If your model expects a specific number of parameter servers or workers (i.e. you expect to use the CUSTOM machine type), use the --parameter-server-count and --worker-count flags to further specify the desired cluster configuration, just as you would in your cloud training job configuration:
$ gcloud alpha ai-platform local train --module-name trainer.task \ --package-path /path/to/my/code/trainer \ --distributed \ --parameter-server-count 4 \ --worker-count 8
Unlike submitting a training job, the --package-path parameter can be omitted, and will use your current working directory.
- POSITIONAL ARGUMENTS
Additional user arguments to be forwarded to user code. Any relative paths will
be relative to the
--package-path. The '--' argument must be specified between gcloud specific args on the left and USER_ARGS on the right.
- REQUIRED FLAGS
- Name of the module to run.
- OPTIONAL FLAGS
- Runs the provided code in distributed mode by providing cluster configurations as environment variables to subprocesses
Google Cloud Storage path or local_directory in which to store training outputs
and other data needed for training.
This path will be passed to your TensorFlow program as the
--job_dircommand-line arg. The benefit of specifying this field is that AI Platform will validate the path for use in training.
Path to a Python package to build. This should point to a directory containing
the Python source for the job. It will be built using
setuptools(which must be installed) using its
parentdirectory as context. If the parent directory contains a
setup.pyfile, the build will use that; otherwise, it will use a simple built-in one.
- Number of parameter servers with which to run. Ignored if --distributed is not specified. Default: 2
Start of the range of ports reserved by the local cluster. This command will use
a contiguous block of ports equal to parameter-server-count + worker-count + 1.
If --distributed is not specified, this flag is ignored.
- Number of workers with which to run. Ignored if --distributed is not specified. Default: 2
- GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account,
--log-http, --project, --quiet, --trace-token, --user-output-enabled,
$ gcloud helpfor details.
- This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you may be trying to access an API with an invitation-only early access whitelist. These variants are also available:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-01-07.