微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Google Cloud Function部署失败-FastAI V2-`pip_install_from_wheels`返回代码:1;

如何解决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中定义了fastaifastcore时,才会发生这种情况。其他软件包运行正常。


潜在的解决方 一对posts如果pip被列为软件包中的依赖项,则会导致Google Cloud Function失败。

我试图将其从.whl中取出并重新包装,但是事实证明这很困难...有没有简单的方法可以做到这一点?


尝试过的其他事情

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 举报,一经查实,本站将立刻删除。