1

I'm deploying my app to heroku however their free tier only allow < 500MB packages, I'm currently using tensorflow and it takes > 500 MB, I can downgrade it to lower version or use the tensorflow-cpu instead, however, I'm also using Keras, which requires at least tensorflow=2.2.0 (so size > 500MB).

I have looked into these two questions but somehow downgrading Keras causes a lot of imcompatible issues.

Deploy python app to Heroku "Slug Size too large"

Error "Keras requires TensorFlow 2.2 or higher"

What I want to achieve is to be able to use Keras while the size of my packages < 500MB so that I can push my app to heroku

Stephen Fong
  • 697
  • 5
  • 17
  • You can try [docker based deployment](https://devcenter.heroku.com/articles/container-registry-and-runtime). This takes some amount of work to setup but you won't be restricted by the slug size. – Sumit Chaturvedi Dec 16 '20 at 06:31
  • I don't see how tensorflow version implies >500 MB. You control size of the model. You can prune it or use reduced precision for starters. Have you considered that? – Lukasz Tracewski Dec 16 '20 at 07:31
  • I don't think he's talking about the model. He is talking about the tensorflow package. The package doesn't meet the size limits of the deployment environment. – Sumit Chaturvedi Dec 16 '20 at 07:41
  • I'm not familiar with docker, is there a step by step procedure that I can follow to deploy my app? @SumitChaturvedi – Stephen Fong Dec 16 '20 at 07:43
  • Docker on Heroku: see here https://stackoverflow.com/a/64817761/9095551 – Beppe C Dec 16 '20 at 12:34
  • Were you able to solve it. If not I can post an answer describing my experience in deploying an app which required pytorch. – Sumit Chaturvedi Dec 17 '20 at 15:54

0 Answers0