Warning: This project is deprecated.
tfc.run
Stay organized with collections
Save and categorize content based on your preferences.
Runs your Tensorflow code in Google Cloud Platform.
tfc.run(
entry_point=None, requirements_txt=None, docker_config='auto',
distribution_strategy='auto', chief_config='auto',
worker_config='auto', worker_count=0, entry_point_args=None,
stream_logs=False, job_labels=None, service_account=None, **kwargs
)
Used in the notebooks
Args |
entry_point
|
Optional string. File path to the python file or iPython
notebook that contains the TensorFlow code.
Note this path must be in the current working directory tree.
Example - 'train.py', 'training/mnist.py', 'mnist.ipynb'
If entry_point is not provided, then
- If you are in an iPython notebook environment, then the
current notebook is taken as the
entry_point .
- Otherwise, the current python script is taken as the
entry_point .
|
requirements_txt
|
Optional string. File path to requirements.txt file
containing additional pip dependencies if any. ie. a file with a
list of pip dependency package names.
Note this path must be in the current working directory tree.
Example - 'requirements.txt', 'deps/reqs.txt'
|
docker_config
|
Optional DockerConfig . Represents Docker related
configuration for the run API.
image: Optional Docker image URI for the Docker image being built.
parent_image: Optional parent Docker image to use.
cache_from: Optional Docker image URI to be used as a cache when
building the new Docker image.
image_build_bucket: Optional GCS bucket name to be used for
building a Docker image via
Google Cloud Build.
Defaults to 'auto'. 'auto' maps to a default tfc.DockerConfig
instance.
|
distribution_strategy
|
'auto' or None. Defaults to 'auto'.
'auto' means we will take care of creating a Tensorflow
distribution strategy instance based on the machine configurations
you have provided using the chief_config , worker_config and
worker_count params.
If the number of workers > 0, we will use
tf.distribute.experimental.MultiWorkerMirroredStrategy or
tf.distribute.experimental.TPUStrategy based on the
accelerator type.
If number of GPUs > 0, we will use
tf.distribute.MirroredStrategy
Otherwise, we will use tf.distribute.OneDeviceStrategy
If you have created a distribution strategy instance in your script
already, please set distribution_strategy as None here.
For example, if you are using tf.keras custom training loops,
you will need to create a strategy in the script for distributing
the dataset.
|
chief_config
|
Optional MachineConfig that represents the
configuration for the chief worker in a distribution cluster.
Defaults to 'auto'. 'auto' maps to a standard gpu config such as
COMMON_MACHINE_CONFIGS.T4_1X (8 cpu cores, 30GB memory,
1 Nvidia Tesla T4).
For TPU strategy, chief_config refers to the config of the host
that controls the TPU workers.
|
worker_config
|
Optional MachineConfig that represents the
configuration for the general workers in a distribution cluster.
Defaults to 'auto'. 'auto' maps to a standard gpu config such as
COMMON_MACHINE_CONFIGS.T4_1X (8 cpu cores, 30GB memory,
1 Nvidia Tesla T4).
For TPU strategy, worker_config should be a TPU config with
8 TPU cores (eg. COMMON_MACHINE_CONFIGS.TPU ).
|
worker_count
|
Optional integer that represents the number of general
workers in a distribution cluster. Defaults to 0. This count does
not include the chief worker.
For TPU strategy, worker_count should be set to 1.
|
entry_point_args
|
Optional list of strings. Defaults to None.
Command line arguments to pass to the entry_point program.
|
stream_logs
|
Boolean flag which when enabled streams logs back from
the cloud job.
|
job_labels
|
Dict of str: str. Labels to organize jobs. You can specify
up to 64 key-value pairs in lowercase letters and numbers, where
the first character must be lowercase letter. For more details see
resource-labels
|
service_account
|
The email address of a user-managed service account
to be used for training instead of the service account that AI
Platform Training uses by default. see custom-service-account
|
**kwargs
|
Additional keyword arguments.
|
Returns |
A dictionary with two keys.'job_id' - the training job id and
'docker_image'- Docker image generated for the training job.
|
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 2021-05-19 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2021-05-19 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-05-19 UTC."],[],[]]