如何在服务/推断期间为Cloud ml-engine设置日志记录

时间:2018-08-28 18:39:08

标签: tensorflow tensorflow-serving stackdriver google-cloud-stackdriver

加载检查点后;我已导出模型,然后将saved_model.pb文件和所有变量复制到GCS存储桶。

在推理/服务期间,出现此错误:

{
  "error": "Prediction failed: Error during model execution: AbortionError(code=StatusCode.FAILED_PRECONDITION, details=\"Attempting to use uninitialized value shadow/LSTMLayers/stack_bidirectional_rnn/cell_0/bidirectional_rnn/fw/basic_lstm_cell/bias\n\t [[Node: shadow/LSTMLayers/stack_bidirectional_rnn/cell_0/bidirectional_rnn/fw/basic_lstm_cell/bias/read = Identity[T=DT_FLOAT, _output_shapes=[[2048]], _device=\"/job:localhost/replica:0/task:0/device:CPU:0\"](shadow/LSTMLayers/stack_bidirectional_rnn/cell_0/bidirectional_rnn/fw/basic_lstm_cell/bias)]]\")"
}

请建议我如何在云ml-engine的测试/推断时间设置日志记录。

1 个答案:

答案 0 :(得分:1)

如果您已设置GCP项目,则可以使用StackDriver Logging API将消息写入日志。然后,您可以从命令行(gcloud logging)或developer console访问日志消息。