减少机器学习的Heroku段塞大小(Python、PyTorch、Fastai)

2024-04-23 09:29:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在heroku上部署一个简单的机器学习应用程序,但我一直超过了500MB的slug大小要求,看起来最终我达到了1GB左右。其中大部分似乎来自PyTorch,容量约为700MB

Collecting torch>=1.0.0
   Downloading torch-1.6.0-cp36-cp36m-manylinux1_x86_64.whl (748.8 MB)

我的requirements.txt文件看起来像

tensorboardX==1.6
opencv-python>=3.3.0.10
pillow>=6.2.1
flask
scikit-image
gunicorn
pandas

我收到的错误信息表明我超过了段塞大小限制

我怎样才能只安装PyTorch的CPU版本来降低slug大小


Tags: 机器应用程序heroku部署torchpytorchx86容量
1条回答
网友
1楼 · 发布于 2024-04-23 09:29:47

尝试将以下行添加到requirements.txt

-f https://download.pytorch.org/whl/torch_stable.html
torch==1.8.1+cpu
torchvision==0.9.1+cpu
fastai
voila
ipywidgets

相关问题 更多 >