模型无法加载到Cloud ML Engine但在本地运行

时间:2017-07-11 21:10:35

标签: tensorflow google-cloud-ml

我使用SavedModel训练并导出了一个模型,正如Online Predict所建议的那样,我在本地进行了测试并且工作正常。

当我要求预测时,我没有解决,无论是在线预测还是批量预测。对于在线预测,我得到了:

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-engine models create $MODEL_NAME --regions=$REGION --enable-logging创建了我的模型,
gcloud ml-engine versions create v1 --model $MODEL_NAME --origin $MODEL_BINARIES --runtime-version 1.2的版本 并使用gcloud ml-engine jobs submit prediction $JOB_NAME --model $MODEL_NAME --version v1 --data-format TEXT --region $REGION --input-paths $INPUT_PATHS --output-path $OUTPUT_PATH

请求批量预测

我无法弄清楚为什么会发生这种情况,因为每个地方预测工作得很好。我错过了什么吗?

0 个答案:

没有答案