googleapis / googleapis/python-aiplatform

Batch predict using custom models with mandatory parameter fields is not supported in vertex AI

オープン
#2,666 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: vertex-ai
主要言語
Python
スター
905
フォーク
465
平均マージ
1日 13時間
マージ済み PR(30日)
44

説明

We have custom models that requires passing mandatory parameter field for prediction.
Now this works for online predictions via endpoint in POST request,
but for batch predictions we have to create jsonl file .
The format of each line in jsonl is something like this

```
{"id1":1,"id2":1,"timestamp":"2023-09-28 09:55:47Z","key1":{some dict},"key2":{some dict}}
{...}
```
etc

This throws below error as parameter field is not present.

We tried adding it too but looks it doesn't work either. Can someone let us know to make it work as I see this as a bug.

#### Environment details

- OS type and version:
- Python version: `Python 3.9.1`
- pip version: `23.2.1`
- `google-cloud-aiplatform` version: `1.33.1`

#### Steps to reproduce

1. deploy a custom model with mandatory parameter in the request body for prediction
2. create batch input jsonl file in gcs bucket , use this file as input to batch predict method of the model.
3. Notice the job completion output error in the gcs bucket.

#### Code example

```python
job = model.batch_predict(machine_type="n1-standard-16", max_replica_count=3, job_display_name="test_score", gcs_source="gs://test/batch_predict_requests.jsonl", batch_size=1000, model_parameters=body["parameters"], gcs_destination_prefix="gs://test/output_dir", sync=True)
```

#### Stack trace
```
('Post request fails. Cannot get predictions. Error: Exceeded retries: Non-OK result 422 ({"detail":[{"loc":["body","parameters"],"msg":"field required","type":"value_error.missing"}]}) from server, retry=3, ellapsed=0.13s.', 1000)
```

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start at the model.batch_predict entry point and trace how the gcs_source JSONL input and model_parameters are converted into batch prediction requests. Reproduce the job with the supplied custom model parameters and confirm that mandatory parameters reach the prediction request without the server's missing-field error.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
cloud, machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。