我試圖用tensorflow對象檢測寵物示例對gcloud ml-engine進行預測,但它不起作用。 https://github.com/tensorflow/models/blob/master/object_detection/g3doc/running_pets.md張量流服務預測不與物體檢測寵物一起使用示例
隨着tensorflow團隊的幫助下,我才得以創建saved_model上傳到gcloud毫升引擎: https://github.com/tensorflow/models/issues/1811
現在,我
我用這個例子中創建了一個檢查點可以將模型上傳到gcloud ml引擎。但不幸的是,我無法對模型做出正確的預測請求。每當我的預測,我得到了同樣的錯誤:
Input instances are not in JSON format.
我試圖做網上預測的結果與
gcloud ml-engine predict --model od_test --version v1 --json-instances prediction_test.json
,我試圖做批量預測與
gcloud ml-engine jobs submit prediction "prediction7"
--model od_test
--version v1
--data-format TEXT
--input-paths gs://ml_engine_test1/prediction_test.json
--output-path gs://ml_engine_test1/prediction_output
--region europe-west1
我想提交一個圖像列表作爲unit8-matrices,所以對於輸出我使用輸入類型image_tensor
。
正如這裏的文檔所述:https://cloud.google.com/ml-engine/docs/concepts/prediction-overview#prediction_input_data,輸入json應該有一個特定的格式。但是在線預測的格式,以及批量預測的格式都無法正常工作。我的最新的測試是與內容的單個文件:
{"instances": [{"values": [1, 2, 3, 4], "key": 1}]}
和內容:
{"images": [0.0, 0.3, 0.1], "key": 3}
{"images": [0.0, 0.7, 0.1], "key": 2}
他們無工作。任何人都可以幫助我,輸入格式應該如何?
編輯
從批量處理中的錯誤是
{
insertId: "1a26yhdg2wpxvg6"
jsonPayload: {
@type: "type.googleapis.com/google.cloud.ml.api.v1beta1.PredictionLogEntry"
error_detail: {
detail: "No JSON object could be decoded"
input_snippet: "Input snippet is unavailable."
}
message: "No JSON object could be decoded"
}
logName: "projects/tensorflow-test-1-168615/logs/worker"
payload: {
@type: "type.googleapis.com/google.cloud.ml.api.v1beta1.PredictionLogEntry"
error_detail: {
detail: "No JSON object could be decoded"
input_snippet: "Input snippet is unavailable."
}
message: "No JSON object could be decoded"
}
receiveTimestamp: "2017-07-28T12:31:23.377623911Z"
resource: {
labels: {
job_id: "prediction10"
project_id: "tensorflow-test-1-168615"
task_name: ""
}
type: "ml_job"
}
severity: "ERROR"
timestamp: "2017-07-28T12:31:23.377623911Z"
}
您所報告的錯誤消息似乎來自'gcloud ml-engine local predict',您能否確認?如果是這樣,服務返回的錯誤信息是什麼? – rhaertel80
你是對的,錯誤似乎來自gcloud,而不是模型。 –
當'json.loads'產生一個'ValueError'時,會出現這個錯誤信息。你介意提供一個副本到我們的輸入文件的鏈接? – rhaertel80