如何将 pytorch 库添加到 Google App Engine

How to add pytorch library to Google App Engine

我正在尝试将 torch==1.7.0+cputorchvision==0.8.1+cpu 库添加到 GAE,

从我的 OS 我可以使用 pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html 来安装它们,但是在 google 应用引擎部署中它只需要来自 requirements.txt 的库。

我尝试通过 pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html -t lib/ 将它们下载到 lib 文件夹并添加到 appengine_config.py

from google.appengine.ext import vendor
vendor.add('lib')

但我一直收到 This deployment has too many files. New versions are limited to 10000 files for this app.,

关于如何实现此目标的任何想法?

我可以通过将 requirements.txt 文件编辑为:

来实现此目的
-f https://download.pytorch.org/whl/torch_stable.html
torch==1.7.0+cpu
torchvision==0.8.1+cpu