【问题标题】:Correct format for input data on CloudMLCloudML 上输入数据的正确格式
【发布时间】:2017-12-06 09:51:56
【问题描述】:

我正在尝试将作业发送到我在 CloudML 上的对象检测模型以获取预测。我正在遵循https://cloud.google.com/ml-engine/docs/online-predict 的指南,但在提交请求时出现错误:

RuntimeError: Prediction failed: Error processing input: Expected uint8, got '\xf6>\x00\x01\x04\xa4d\x94...(更多字节)...\x00\x10\x10\x10\x04 'str' 类型的 \x80\xd9' 代替。

这是我的代码:

img = base64.b64encode(open("file.jpg", "rb").read()).decode('utf-8')
json = {"b64": img}
result = predict_json(project, model, json, "v1")

【问题讨论】:

    标签: tensorflow object-detection


    【解决方案1】:

    我的错,我导出图表时忘记添加--input_type encoded_image_string_tensor

    【讨论】:

    • 我也忽略了这一点。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 2016-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-28
    • 2019-10-26
    • 1970-01-01
    相关资源
    最近更新 更多