Hi!
Trying to put a small Tabular Model in the cloud, but the fastai
installation is failing.
Typically we are able to install packages by defining the 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
...
The error thrown is:
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
Note that this ONLY occurs if fastai
or fastcore
is defined in the requirements.txt. Other packages work fine.
Potential Solution
There have been a couple posts saying if pip
is listed as a dependancy in the package, that it will cause a failure in a Google Cloud Function.
Is pip
listed as a dependency in fastai? And how could it be removed?
I attempted removing from requires.txt
and repackaging, but this proved to be difficult… Is there an easy way to do this?
Other Things Tried
-
Installing w/ various versions of pip defined in the
requirements.txt
(18.1, 19.0.3, 19.0.1) - although this shouldn’t be necessary… - Updating gcloud:
gcloud components update
- Manually saving
fastcore
andfastai
in the package to be uploaded. For some reason it’s having troubles resolvingfastcore.test
although I would think this would work…
There are a couple resources for FastAI v1, but unfortunately falls short in V2:
[https://jianjye.medium.com/how-to-deploy-fast-ai-models-to-google-cloud-functions-for-predictions-e3d73d71546b](https://blog post)