python-3.x - GCP AI 平台上 TensorFlow 模型的输入格式
问题描述
我已将模型上传到 GCP AI Platform Models。这是一个简单的 Keras 多步模型,具有 5 个在 168 个滞后值上训练的特征。当我尝试在其中测试模型时,我收到了这个奇怪的错误消息:
"error": "Prediction failed: Error during model execution: <_MultiThreadedRendezvous of RPC that terminated with:\n\tstatus = StatusCode.FAILED_PRECONDITION\n\tdetails = \"Error while reading resource variable dense_7/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/dense_7/bias)\n\t [[{{node model_2/dense_7/BiasAdd/ReadVariableOp}}]]\"\n\tdebug_error_string = \"{\"created\":\"@1618946146.138507164\",\"description\":\"Error received from peer ipv4:127.0.0.1:8081\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1061,\"grpc_message\":\"Error while reading resource variable dense_7/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/dense_7/bias)\\n\\t [[{{node model_2/dense_7/BiasAdd/ReadVariableOp}}]]\",\"grpc_status\":9}\"\n>"
输入采用以下格式,列表 ((1, 168, 5))
请参见下面的示例:
{
"instances":
[[[ 3.10978284e-01, 2.94650396e-01, 8.83664149e-01,
1.60210423e+00, -1.47402699e+00],
[ 3.10978284e-01, 2.94650396e-01, 5.23466315e-01,
1.60210423e+00, -1.47402699e+00],
[ 8.68576328e-01, 7.78699823e-01, 2.83334426e-01,
1.60210423e+00, -1.47402699e+00]]]
}
解决方案
推荐阅读
- jquery - Django 数据表视图过滤器/搜索
- amazon-web-services - 模块初始化错误:
- mongodb - 在 MongoDB 中获取匹配的数组数据
- javascript - 使用正则表达式删除字符直到最后 -
- python - 根据时间条件获取每个组的最大值
- android - Autoplay Images in Accompanist Pager
- html - When box height *vh row inside box is too long and dont work with min-height/height
- javascript - Why I get "Uncaught ReferenceError: users_test is not defined at HTMLButtonElement.onclick"?
- puppeteer - How to select a drop down menu option in Puppeteer bot?
- python - Discovered resources returning a blank list even when resources exist AWS