Tensorflow 模型未能在Cloud ML引擎上加载,但在本地工作
我使用SavedModel训练并导出了一个模型,正如在上所建议的那样,我在本地对其进行了测试,效果很好 当我要求进行预测时,无论是在线预测还是批量预测,我都没有计算出来。对于在线预测,我得到:Tensorflow 模型未能在Cloud ML引擎上加载,但在本地工作,tensorflow,google-cloud-ml,Tensorflow,Google Cloud Ml,我使用SavedModel训练并导出了一个模型,正如在上所建议的那样,我在本地对其进行了测试,效果很好 当我要求进行预测时,无论是在线预测还是批量预测,我都没有计算出来。对于在线预测,我得到: jsonPayload: { @type: "type.googleapis.com/google.cloud.ml.v1.PredictionLogEntry" message: "{"error": "Prediction failed: Exception during mode
jsonPayload: {
@type: "type.googleapis.com/google.cloud.ml.v1.PredictionLogEntry"
message: "{"error": "Prediction failed: Exception during model execution:
AbortionError(code=StatusCode.FAILED_PRECONDITION,
details=\"Attempting to use uninitialized value bout/weight\n\t
[[Node: bout/weight/read = Identity[T=DT_FLOAT,
_class=[\"loc:@bout/weight\"],
_output_shapes=[[1,2]],
_device=\"/job:localhost/replica:0/task:0/cpu:0\"](bout/weight)]]
\")"}"
numInstances: "1"
对于批次预测:
16:21:35.855
PermanentException: Failed to load the model due to bad model data. [while running 'BATCH_PREDICTION/Prediction/ParDo(PredictionDoFn)/Do']
{
insertId: "xunb3og1phwaag"
logName: "projects/toycloudml/logs/ml.googleapis.com%2Fdnn_test3"
receiveTimestamp: "2017-07-11T19:21:35.855457468Z"
resource: {
labels: {
job_id: "dnn_test3"
project_id: "toycloudml"
task_name: "service"
}
type: "ml_job"
}
severity: "ERROR"
textPayload: "PermanentException: Failed to load the model due to bad model data. [while running 'BATCH_PREDICTION/Prediction/ParDo(PredictionDoFn)/Do']
"
timestamp: "2017-07-11T19:21:35.855457468Z"
}
我使用gcloud ml引擎模型创建$model\u NAME--regions=$REGION--enable logging
,具有
gcloud ml引擎版本的版本创建v1--model$model\u NAME--origin$model\u二进制文件--runtime version 1.2
并请求使用
gcloud ml引擎作业提交预测$JOB\u NAME--model$model\u NAME--version v1--data format TEXT--region$region--input path$input\u path--output path$output\u path的批处理预测
我不明白为什么会发生这种情况,因为每一种方法都能很好地适应当地的预测。我遗漏了什么吗?要在本地测试,您是否使用了
gcloud ml engine local predict
?是的,我使用的是gcloud ml engine local predict--model dir=$model\u dir--json instances=$INPUT\u DATA\u FILE
,乍一看,这似乎是个bug。我们可以帮助调查您是否愿意将您的项目/模型/版本名发送到(私人)邮件列表cloudml-feedback@google.com.Can您是否共享批次预测的完整日志条目?@rhaertel80我已按要求发送了信息