Gerard
Gerard

Reputation: 2860

Invalid JSON payload received with AutoML Object Detection

When trying to run the salad example in Object Detection AutoML quickstart I get an error. After having successfully created my dataset I run the curl command to import data:

curl -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" https://automl.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/us-central1/datasets/${DATASET}:importData -d '{
  "input_config": {
    "gcs_source": {
       "input_uris": [
         "gs://cloud-ml-data/img/openimage/csv/salads_ml_use.csv"
        ]
    }
  }

But I get the error

{
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Expected an object key or }.\n  \"input_config\": {\n^",
    "status": "INVALID_ARGUMENT"
  }
}

Any ideas? I tried change the input_config to inputConfig but to no avail.

Upvotes: 1

Views: 607

Answers (1)

ebeltran
ebeltran

Reputation: 469

Your not closing the payload with '

It should be like this one

curl -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" https://automl.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/us-central1/datasets/${DATASET}:importData -d '{
  "input_config": {
    "gcs_source": {
       "input_uris": [
         "gs://cloud-ml-data/img/openimage/csv/salads_ml_use.csv"
        ]
    }
  }'

Upvotes: 1

Related Questions