【发布时间】:2019-08-19 00:45:37
【问题描述】:
我正在尝试使用 google cloud ml 引擎进行预测。我使用fast-style-transfer 生成了我的模型,并将其保存在我的 google cloud ml 引擎的模型部分。对于输入,它使用 float32,所以我必须以这种格式转换我的图像。
image = tf.image.convert_image_dtype(im, dtypes.float32)
matrix_test = image.eval()
然后我为请求生成了我的 json 文件:
js = json.dumps({"image": matrix_test.tolist()})
使用以下代码:
gcloud ml-engine predict --model {model-name} --json-instances request.json
返回如下错误:
ERROR: (gcloud.ml-engine.predict) HTTP request failed. Response: {
"error": {
"code": 400,
"message": "Request payload size exceeds the limit: 1572864 bytes.",
"status": "INVALID_ARGUMENT"
}
}
我想知道我是否可以增加此限制,如果不能,是否有办法通过变通方法解决它...提前致谢!
【问题讨论】:
标签: python-2.7 tensorflow google-cloud-ml