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 (将#修改为@)