如何解决Google Cloud Function部署失败-FastAI V2-`pip_install_from_wheels`返回代码:1;
尝试将小型表格模型放入云中,但是fastai
安装失败。
通常,我们可以通过定义requirements.txt
requirements.txt
...
# Install pyTorch Works
https://download.pytorch.org/whl/cpu/torch-1.7.0%2Bcpu-cp37-cp37m-linux_x86_64.whl # Works
https://download.pytorch.org/whl/cpu/torchvision-0.8.0-cp37-cp37m-linux_x86_64.whl # Works
# Fails
fastai==2.0.18
# Fails as well even if done separately
fastcore==1.2.5
...
引发的错误是:
deploying function (may take a while - up to 2 minutes)...Failed.
ERROR: (gcloud.functions.deploy) OperationError: code=3,message=Build Failed: `pip_install_from_wheels` had stderr output:
/opt/python3.7/bin/python3.7: No module named pip
error: `pip_install_from_wheels` returned code: 1; Error ID: ECB5F712
请注意,只有在requirements.txt中定义了fastai
或fastcore
时,才会发生这种情况。其他软件包运行正常。
潜在的解决方案
一对posts说如果pip
被列为软件包中的依赖项,则会导致Google Cloud Function失败。
我试图将其从.whl
中取出并重新包装,但是事实证明这很困难...有没有简单的方法可以做到这一点?
尝试过的其他事情
- Installing w/ various versions of pip defined in the
requirements.txt
(18.1,19.0.3,19.0.1)-尽管这不是必需的... - 更新gcloud:
gcloud components update
- 在要上传的包中手动保存
fastcore
和fastai
。由于某种原因,它在解决fastcore.test
时遇到了麻烦,尽管我认为这会起作用...
FastAI v1有几个资源,但不幸的是在V2中不足: [https://jianjye.medium.com/how-to-deploy-fast-ai-models-to-google-cloud-functions-for-predictions-e3d73d71546b](https://blog post)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。