client, err := automl.NewPredictionClient(ctx) .... req := &automlpb.PredictRequest{ Name: fmt.Sprintf("projects/%s/locations/%s/models/%s", "MY_PROJECT_ID", "LOCATION", "MODEL_ID"), //<= where can I get this Model's Prefix Payload: &automlpb.ExamplePayload{ Payload: &automlpb.ExamplePayload_Image{ Image: &automlpb.Image{ Data: &automlpb.Image_ImageBytes{ ImageBytes: bytes, }, }, }, }, // Params is additional domain-specific parameters. Params: map[string]string{ // score_threshold is used to filter the result. "score_threshold": "0.1", }, } resp, err := client.Predict(ctx, req) if err != nil { return fmt.Errorf("Predict: %v", err) }
Hi,
You get the error because you are using the old AutoML API to run predictions. See model_id created when the old AutoML API is used.
Since you have trained your model using Vertex AutoML Classification (you got the 18 digit number), you should use aiplatform to run your predictions. See sample prediction code.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |