Beruflich Dokumente
Kultur Dokumente
(https://cloud.google.com/ml-engine/docs/technical-overview#end-to-end_overview)
1) Prepare your trainer and data for the cloud
Cloud ML Engine is your training application, written in TensorFlow
This application is responsible for defining your computation graph, managing the training and validation process, and
exporting your model
You need to follow a few guidelines about your approach to work well with cloud training
If you have a TensorFlow application that you have been running locally on a single computer, the biggest change you are
likely to need to make to your application is to add support for running it with distributed TensorFlow
Make your trainer into a Python package and stage it on Google Cloud Storage where your training job can access it
3) Get predictions
Cloud ML Engine supports two kinds of prediction: online and batch
Online prediction is optimized for handling a high rate of requests with minimal latency. You give it your data in a JSON
request string and it returns predictions for that data in its response message.
Batch prediction is optimized for getting inferences for large collections of data with minimal job duration.
You put your input data instances in files on Google Cloud Storage and pass their paths to a job request.
The service allocates a cluster of machines to run your prediction job and distributes your input data among them. It saves
your predictions to files in a Google Cloud Storage location that you specify
You should have completed these steps before you submit training jobs:
Configure your development environment.
Develop your trainer application with TensorFlow.
Package your application and upload it and any unusual dependencies to a Google Cloud Storage bucket (this
step is included in job creation when you use the gcloud command-line tool).
If you use the gcloud tool to package your application, you don't need to create a setup.py or any __init__.py files. When
you run gcloud ml-engine jobs submit training, you can set the --package_path argument to the path of your main
project directory, or you can run the tool from that directory and omit the argument altogether
This example command shows you how to use a zipped tarball package (called trainer-0.0.1.tar.gz here) that is in a Cloud
Storage bucket. The main function is in a module called task.py
PATH_TO_PACKAGED_TRAINER=gs://$CLOUD_STORAGE_BUCKET_NAME/trainer-0.0.0.tar.gz