0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

herokuへgit pushが500M制限オーバーでエラーになる

Last updated at Posted at 2022-07-13

djangoとpytorchを用いた画像認識Webアプリを作成し、herokuへ git pushしたらエラーになり失敗。pushできない

Compiled slug size: xxxM is too large (max is 500M).

容量オーバーのようです。モデルは50MB程度、
何が大きいのか確認すると、

Downloading torch-1.11.0-cp39-cp39-manylinux1_x86_64.whl (750.6 MB)

Pytorchが750MBもある。


Pytorchはgpu用がサイズが大きく、cpu用を指定するとサイズ削減できるとのことで

requirements.txt の Pytorch部分を修正する。

変更前

requirements.txt
torch==1.11.0

変更後

requirements.txt
-f https://download.pytorch.org/whl/torch_stable.html
torch==1.11.0+cpu

170MBになり、問題なくherokuにgit pushもできました。

Downloading https://download.pytorch.org/whl/cpu/torch-1.11.0%2Bcpu-cp39-cp39-linux_x86_64.whl (169.2 MB)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?