【问题标题】:Tensorflow dependency causing Heroku app to exceed maximum slug sizeTensorflow 依赖导致 Heroku 应用程序超过最大 slug 大小
【发布时间】:2020-08-12 00:01:36
【问题描述】:

我正在 Heroku 上部署一个应用程序,它具有 tensorflow 作为依赖项,但安装 tensorflow 会导致它超过最大 slug 大小,上限为 500M。我知道这一点,因为我可以在 requirements.txt 中不使用 tensorflow 进行推送。 Heroku 文档说使用 .slugignore 文件忽略未使用的静态文件或依赖项,但绝对需要 tensorflow 否则应用程序将不会实际运行......我必须包含它。我该如何解决这个问题?

remote: -----> Compressing...
remote:  !     Compiled slug size: 610.3M is too large (max is 500M).
remote:  !     See: http://devcenter.heroku.com/articles/slug-size
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to safe-fjord-13722.
remote: 
To https://git.heroku.com/safe-fjord-13722.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/safe-fjord-13722.git

【问题讨论】:

    标签: tensorflow heroku deployment web-applications


    【解决方案1】:

    如果您在将深度学习模型部署到 Heroku 时仍然遇到问题,请务必记住 TensorFlow 2.0 出于某种原因约为 500 MB,而早期版本要小得多。使用先前版本的 TensorFlow 将大大减少 slug 的大小。尝试使用 TensorFlow 1,它会将您的模型大小减少 50% 或更多

    Slug 大小限制为 500MB,如下所述:https://devcenter.heroku.com/articles/slug-compiler#slug-size

    【讨论】:

    • 解决了!早期版本仍然可以正常工作。谢谢!
    猜你喜欢
    • 2021-08-31
    • 2022-07-12
    • 1970-01-01
    • 2018-01-14
    • 2011-11-12
    • 1970-01-01
    • 2023-04-07
    • 2015-07-23
    • 1970-01-01
    相关资源
    最近更新 更多