我试图用Google的可解释的ai来解释一个图像预测模型,但是我得到了一个429错误。我想要解释的模型是一个使用移动网络v3大模型并应用迁移学习的模型。
python代码:
ig_response = remote_ig_model.explain(instances)
结果:
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"
}
}
当使用ai-platform创建服务模型时,命令如下所示。
代码:
! 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
我得到了一个429错误,并试图改变机器类型(N1-标准-4 -> N1-高but 32),但错误没有解决。
发布于 2021-07-13 14:54:10
您可以查看这个故障排除部分,您的请求不能大于1.5Mb
单个在线预测请求必须包含不超过1.5MB的数据。
如果输入为1024, 1024 ,3,则图像大小应为3Mb (1024x1024x3字节),因此对于API来说太大了。
https://stackoverflow.com/questions/68356127
复制相似问题