【发布时间】:2019-02-13 01:15:32
【问题描述】:
我想使用 Google Cloud Functions 部署一个以 JSON 格式保存的 keras 模型(包括 HDF5 中的权重),并将 tensorflow 作为后端。
我在 requirements.txt 中没有指定 tensorflow 时部署成功。虽然在 GCP 中测试函数时,我收到错误消息,指出找不到 tensorflow。
Error: function crashed. Details:
No module named 'tensorflow'
首先,我觉得很奇怪 Google 没有提供预装 tensorflow 的环境。
但现在如果我在 requirements.txt 中指定 tensorflow,部署将失败并显示错误消息
ERROR: (gcloud.beta.functions.deploy) OperationError:
code=3, message=Build failed: USER ERROR:
`pip_download_wheels` had stderr output:
Could not find a version that satisfies the
requirement tensorflow (from -r /dev/stdin (line 5))
(from versions: )
No matching distribution found for tensorflow (from -r
/dev/stdin (line 5))
有没有办法让我在 Cloud Functions 上获得 TensorFlow,或者 Google 故意阻止安装以让我们使用 ML Engine?
【问题讨论】:
标签: python tensorflow keras google-cloud-platform google-cloud-functions