简体   繁体   English

谷歌云 Function Gen 1 部署失败

[英]Google Cloud Function Gen 1 Deployment Failure

This is mostly for the community, because it took me quite a while to figure out.这主要是为了社区,因为我花了很长时间才弄清楚。

I have a python 3.9 environment stateless Google Cloud Function using pytorch. The initial deployment and function creation has no errors/issues.我有一个 python 3.9 环境无状态谷歌云 Function 使用 pytorch。初始部署和 function 创建没有错误/问题。 Requirements.txt looks like this: Requirements.txt看起来像这样:

torch==1.10.2

However, when I edit even the smallest, innocuous change and save, the deployment fails with the error:然而,当我编辑甚至是最小的、无害的更改并保存时,部署失败并出现错误:

Build failed:
Collecting torch==1.10.2; Error ID: c84b3231

How do you redeploy with pytorch?您如何使用 pytorch 重新部署?

I still do not know the reason why installing pytorch on redeploy fails, but this is how I got Google Cloud Function to consistently redeploy without fail.我仍然不知道重新部署时安装 pytorch 失败的原因,但这就是我让 Google Cloud Function 始终如一地重新部署而不会失败的原因。 I directly input the specific version of PyTorch link: linux, cpu-based, version.具体版本我直接输入PyTorch链接:linux,cpu-based,版本。

  1. Go to the latest versions of PyTorch: PyTorch Latest Releases . Go 到 PyTorch 的最新版本: PyTorch 最新版本
  2. Search for the desired version (currently, the latest is 1.10.2).搜索所需的版本(目前最新的是 1.10.2)。 I chose torch-1.10.2%2Bcpu-cp39-cp39-linux_x86_64.whl .我选择了torch-1.10.2%2Bcpu-cp39-cp39-linux_x86_64.whl
  3. Copy link and paste in requirements.txt by replacing torch==1.10.2 .复制链接并通过替换torch==1.10.2粘贴到requirements.txt中。

If anybody knows why Google Cloud Function Gen 1 rejects redeployment with the conventional distribution of torch, feel free to edit.如果有人知道为什么 Google Cloud Function Gen 1 拒绝使用传统的火炬分发进行重新部署,请随时编辑。

Hope this saves someone time.希望这可以节省一些时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM