Search code examples
pythontensorflowgoogle-cloud-platformobject-detection

Google Cloud Platform Training Issue


System information

  1. OS Platform and Distribution: Windows 10 64 Bit
  2. TensorFlow installed from (source or binary): binary
  3. TensorFlow version :1.4.0
  4. Python version 3.5.2(v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55)
  5. GPU:nVidia GeForce 755M 2GB CPU: Intel x64-64 Intel Core i5-4200M CPU @2.50Ghz, 8GB memory

Describe the problem I could train the model locally. The accuracy was decent but I wanted to try and use GCP to get similar results. I followed the google documentation mentioned here:

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_on_cloud.md

https://medium.com/google-cloud/object-detection-tensorflow-and-google-cloud-platform-72e0a3f3bdd6

When I try to run the training session on the cloud using the following command:

gcloud ml-engine jobs submit training object_detection_188001 \ --job-dir=gs://weeddetection/train \ --packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz \ --module-name object_detection.train \ --region us-central1 \ --config object_detection/samples/cloud/cloud.yml \ --train_dir=gs://weeddetection/train \ --pipeline_config_path=gs://weeddetection/data/ssd_mobilenet_v1_pets.config

I get the following error:

ERROR: (gcloud.ml-engine.jobs.submit.training) unrecognized arguments:
  \
  \
  \
  \
  \
  \
  --train_dir=gs://weeddetection/train
  \
  --pipeline_config_path=gs://weeddetection/data/ssd_mobilenet_v1_pets.config
weeddetection is my GC bucket name and 188001 is my shell ID. 

Solution

  • When you include custom options like --train-dir and --pipeline_config_path, you need to put them at the end of the command. You also need to separate the command's options and your options with --. Try this:

    gcloud ml-engine jobs submit training object_detection_188001 --job-dir=gs://weeddetection/train --packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz --module-name object_detection.train --region us-central1 --config object_detection/samples/cloud/cloud.yml -- --train_dir=gs://weeddetection/train --pipeline_config_path=gs://weeddetection/data/ssd_mobilenet_v1_pets.config