Google Cloud Platform – Machine Learning as a Service

Links:

Google Cloud Console: https://console.cloud.google.com/home/

An example on Census dataset: https://github.com/GoogleCloudPlatform/cloudml-samples/tree/master/census

Common Commands:

gcloud ml-engine jobs describe [JOB_NAME]

gcloud ml-engine jobs cancel [JOB_NAME]

Related Concepts:

Wide models v.s. deep models

https://www.tensorflow.org/tutorials/wide_and_deep

Embedding columns: suitable for sparse attributes (e.g., native_country, occupation)

https://www.tensorflow.org/programmers_guide/embedding

Note:

Error Message:

Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/trainer/task.py", line 4, in <module> import model File "/root/.local/lib/python2.7/site-packages/trainer/model.py", line 40, in <module> tf.feature_column.categorical_column_with_vocabulary_list( AttributeError: 'module' object has no attribute 'feature_column'

Solution:

Change runtime version from 1.0 to 1.2

gcloud ml-engine jobs submit training $JOB_NAME \
                                    --stream-logs \
                                    --scale-tier $SCALE_TIER \
                                    --runtime-version 1.2 \
                                    --job-dir $GCS_JOB_DIR \
                                    --module-name trainer.task \
                                    --package-path trainer/ \
                                    --region us-central1 \
                                    -- \
                                    --train-files $TRAIN_FILE \
                                    --eval-files $EVAL_FILE \
                                    --train-steps $TRAIN_STEPS \
                                    --eval-steps 100
Advertisements