在Heroku上部署我的应用程序时出错-TensorFlow

时间:2019-12-17 20:20:42

标签: tensorflow heroku

我想在包含使用Tensorflow的应用程序的heroku上部署我的flask应用程序,但是我收到此错误:

remote:        Collecting tensorboard==2.0.2 (from -r /tmp/build_e8c9bbdcb75f1c632603c5c3412543f6/requirements.txt (line 53))
remote:          Downloading https://files.pythonhosted.org/packages/76/54/99b9d5d52d5cb732f099baaaf7740403e83fe6b0cedde940fabd2b13d75a/tensorboard-2.0.2-py3-none-any.whl (3.8MB)
remote:        Collecting tensorflow==2.0.0 (from -r /tmp/build_e8c9bbdcb75f1c632603c5c3412543f6/requirements.txt (line 54))
remote:          Could not find a version that satisfies the requirement tensorflow==2.0.0 (from -r /tmp/build_e8c9bbdcb75f1c632603c5c3412543f6/requirements.txt (line 54)) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
remote:        No matching distribution found for tensorflow==2.0.0 (from -r /tmp/build_e8c9bbdcb75f1c632603c5c3412543f6/requirements.txt (line 54))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to i-sip111.

能否请您指导我如何解决此问题。我在虚拟环境中的python版本是3.7.3,在推送时收到错误。

2 个答案:

答案 0 :(得分:0)

如Tensorflow安装指南(https://www.tensorflow.org/install)中所述,它要求pip版本> 19.0。您跑步了吗?

pip install --upgrade pip

在安装tensorflow之前?

答案 1 :(得分:0)

我最近遇到了同样的问题。在错误响应中,它列出了由于Heroku上的pip版本而导致当前可用的所有版本。

在虚拟环境中使用以下命令将TensorFlow的版本降级为它们支持的最新版本:

pip install tensorflow==2.0.0b1

然后使用以下命令更新您的requirements.txt文件

pip freeze > requirements.txt

最后,再次将您的应用程序推送到Heroku,您应该已经准备就绪。 :)

git push heroku master

Reference issue on Tensorflow Github

相关问题