Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Vertex Object Classification Import file issues

I am following the documentation on how to Prepare image training data for Object Classifiction which creates a JSONL schema like:

{
  "imageGcsUri": "gs://bucket/filename.ext",
  "classificationAnnotation": {
    "displayName": "LABEL",
    "annotationResourceLabels": {
        "aiplatform.googleapis.com/annotation_set_name": "displayName",
        "env": "prod"
      }
   },
  "dataItemResourceLabels": {
    "aiplatform.googleapis.com/ml_use": "training/test/validation"
  }
}

So I prepare a JSONL file like:

{"imageGcsUri":"gs://my-bucket-url/1/IMG_0822.jpg","classificationAnnotation":{"displayName":"1"}}
{"imageGcsUri":"gs://my-bucket-url/2/IMG_0823.jpg","classificationAnnotation":{"displayName":"2"}}
{"imageGcsUri":"gs://my-bucket-url/3/IMG_0824.jpg","classificationAnnotation":{"displayName":"3"}}
{"imageGcsUri":"gs://my-bucket-url/4/IMG_0825.jpg","classificationAnnotation":{"displayName":"4"}}

 However, the upload fails in Vertex due to unknown issue as the error message is blank.

If I remove the classificationAnnotation field, the upload succeeds.  

The documentation says the imageGcsUri field is the only required field.


What is wrong with my syntax of including classificationAnnotation?

1 2 195
2 REPLIES 2

Hi @identafly ,

The issue is that your classificationAnnotation in the JSONL is using an inline JSON string, but it should be a proper nested JSON object — not quoted.

Example (correct format):
{"imageGcsUri":"gs://my-bucket-url/IMG_0822.jpg","classificationAnnotation":{"displayName":"1"}}
So, just remove the extra quotes around classificationAnnotation.


I’m sorry but I don’t see the extra quotes you’re referring to. Can you please clarify?