I'm trying to interpret an image prediction model using Google's explainable ai, but I get a 429 error. The model I want to interpret is a model that uses the mobilenet v3 large model and applies transfer learning.
python code :
ig_response = remote_ig_model.explain(instances)
results :
ValueError: Target URI https://asia-northeast1- ml.googleapis.com/v1/projects/cellimaging/models/A549_4/versions/v_ig_4:explain returns HTTP 429 error.
Please check the raw error message:
{
"error": {
"code": 429,
"message": "Rate of traffic exceeds serving capacity. Decrease your traffic or reduce the size of your model: projects/842842301933/models/A549_4/versions/v_ig_4.",
"status": "RESOURCE_EXHAUSTED"
}
}
When creating a serving model using ai-platform, the command is as follows.
code :
! gcloud beta ai-platform versions create $IG_VERSION --region='asia-northeast1' \
--model $MODEL \
--origin $export_path \
--runtime-version 2.2 \
--framework TENSORFLOW \
--python-version 3.7 \
--machine-type n1-highcpu-32 \
--explanation-method integrated-gradients \
--num-integral-steps 25
I got a 429 error and tried changing the machine-type (n1-standard-4 -> n1-highcpu-32), but the error is not resolved.
You can have a look on this troubleshoot section, your request can't be larger than 1.5Mb
A single online prediction request must contain no more than 1.5 MB of data.
If you have an input of 1024,1024,3, your image size should be 3Mb (1024 x 1024 x 3 bytes) and therefore too big for the API.