Error when following google object detection API t

2019-08-02 15:56发布

问题:

While following the tutorial in here, I've reached the stage of training the model on the cloud. Unfortunately, the command

gcloud ml-engine jobs submit training `whoami`_object_detection_`date +%s` \
    --job-dir=gs://${YOUR_GCS_BUCKET}/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://${YOUR_GCS_BUCKET}/train \
    --pipeline_config_path=gs://${YOUR_GCS_BUCKET}/data/faster_rcnn_resnet101_pets.config

yields the following error:

ERROR: (gcloud.ml-engine.jobs.submit.training) FAILED_PRECONDITION: Field: package_uris Error: The provided GCS paths [gs://pet-detector-test/train/packages/[REMOVED]/slim-0.1.tar.gz, gs://pet-detector-test/train/packages/[REMOVED]/object_detection-0.1.tar.gz] cannot be read by service account service-[REMOVED]@cloud-ml.google.com.iam.gserviceaccount.com.

Note: I have removed some specific identifiers from the error message and changed them to [REMOVED]

The bucket seems to contain all the necessary data,

Any idea how to proceed?

回答1:

The problem was due to skipping a step in here.
Specifically - use the following commands:

gcloud config set project [your-project-id]
gcloud auth application-default login