Search code examples
google-cloud-ml-engine

Training locally with ML Engine & GCloud


I would like to train my model locally using this command:

gcloud ml-engine local train
  --module-name cloud_runner
  --job-dir ./tmp/output

The issue is that it complains that --job-dir: Must be of form gs://bucket/object.

This is a local train so I'm wondering why it wants the output to be a gs storage bucket rather than a local directory.


Solution

  • As explained by other gcloud --job-dir expects the location to be in GCS. To go around that you can pass it as a folder directly to your module.

    gcloud ml-engine local train \
        --package-path trainer \
        --module-name trainer.task \
        -- \
        --train-files $TRAIN_FILE \
        --eval-files $EVAL_FILE \
        --job-dir $JOB_DIR \
        --train-steps $TRAIN_STEPS