Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当时我在Heroku部署django应用程序时;编译的段塞大小太大”;发生错误_Django_Git_Heroku_Django Deployment - Fatal编程技术网

当时我在Heroku部署django应用程序时;编译的段塞大小太大”;发生错误

当时我在Heroku部署django应用程序时;编译的段塞大小太大”;发生错误,django,git,heroku,django-deployment,Django,Git,Heroku,Django Deployment,在将我的django项目部署到heroku时,我遵循了中提到的确切步骤 但是,对于git-push-heroku-master,我得到了以下错误: 请告诉我可能出现的问题 供参考: absl-py==0.12.0 astunparse==1.6.3 cachetools==4.2.1 certifi==2020.12.5 chardet==4.0.0 cycler==0.10.0 dj-database-url==0.5.0 Django==1.10 django-heroku==0.3.1

在将我的django项目部署到heroku时,我遵循了中提到的确切步骤

但是,对于
git-push-heroku-master
,我得到了以下错误:

请告诉我可能出现的问题

供参考

absl-py==0.12.0
astunparse==1.6.3
cachetools==4.2.1
certifi==2020.12.5
chardet==4.0.0
cycler==0.10.0
dj-database-url==0.5.0
Django==1.10
django-heroku==0.3.1
gast==0.3.3
google-auth==1.28.0
google-auth-oauthlib==0.4.4
google-pasta==0.2.0
grpcio==1.36.1
gunicorn==20.1.0
h5py==2.10.0
idna==2.10
importlib-metadata==3.10.0
joblib==1.0.1
Keras==2.4.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
Markdown==3.3.4
matplotlib==3.4.1
numpy==1.20.2
oauthlib==3.1.0
opt-einsum==3.3.0
pandas==1.1.5
pickle5==0.0.11
Pillow==8.2.0
protobuf==3.15.7
psycopg2==2.8.6
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
PyYAML==5.4.1
requests==2.25.1
requests-oauthlib==1.3.0
rsa==4.7.2
scikit-learn==0.24.1
scipy==1.4.1
seaborn==0.11.1
six==1.15.0
tensorboard==2.2.2
tensorboard-plugin-wit==1.8.0
tensorflow==2.2.0
tensorflow-estimator==2.2.0
termcolor==1.1.0
threadpoolctl==2.1.0
typing-extensions==3.7.4.3
urllib3==1.26.4
Werkzeug==1.0.1
whitenoise==5.2.0
wrapt==1.12.1
zipp==3.4.1
我的项目根目录中有
Procfile
requirements.txt
runtime.txt
。我也确信我的证件是正确的。此外,我以前没有向master推送过任何东西,我是这个应用程序的唯一所有者

我的
runtime.txt
的代码是:python:3.7.9

我的
Procfile
有代码:web:gunicorn cardamage.wsgi——日志文件-

Myrequirements.txt

absl-py==0.12.0
astunparse==1.6.3
cachetools==4.2.1
certifi==2020.12.5
chardet==4.0.0
cycler==0.10.0
dj-database-url==0.5.0
Django==1.10
django-heroku==0.3.1
gast==0.3.3
google-auth==1.28.0
google-auth-oauthlib==0.4.4
google-pasta==0.2.0
grpcio==1.36.1
gunicorn==20.1.0
h5py==2.10.0
idna==2.10
importlib-metadata==3.10.0
joblib==1.0.1
Keras==2.4.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
Markdown==3.3.4
matplotlib==3.4.1
numpy==1.20.2
oauthlib==3.1.0
opt-einsum==3.3.0
pandas==1.1.5
pickle5==0.0.11
Pillow==8.2.0
protobuf==3.15.7
psycopg2==2.8.6
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
PyYAML==5.4.1
requests==2.25.1
requests-oauthlib==1.3.0
rsa==4.7.2
scikit-learn==0.24.1
scipy==1.4.1
seaborn==0.11.1
six==1.15.0
tensorboard==2.2.2
tensorboard-plugin-wit==1.8.0
tensorflow==2.2.0
tensorflow-estimator==2.2.0
termcolor==1.1.0
threadpoolctl==2.1.0
typing-extensions==3.7.4.3
urllib3==1.26.4
Werkzeug==1.0.1
whitenoise==5.2.0
wrapt==1.12.1
zipp==3.4.1

允许的最大slug大小(压缩后)为500MB英寸。您编译的
slug大小
太大,因为您使用的是
Tensorflow
模块

Tensorflow
模块非常大(超过500MB,Heroku的限制),因为它支持GPU。由于Heroku不支持GPU,因此安装支持GPU的模块没有意义

pip install tensorflow-cpu
只需将
tensorflow
替换为
tensorflow cpu
中的需求.py

--------------------或--------------------

只需执行以下操作,将您的
TensorFlow
版本替换为2.0.0即可:

tensorflow==2.0.0

它有一个重量轻得多的文件,可以满足您的内存限制。此外,您还可以使用1.7.01.5.0版本

更新

absl-py==0.12.0
astunparse==1.6.3
cachetools==4.2.1
certifi==2020.12.5
chardet==4.0.0
cycler==0.10.0
dj-database-url==0.5.0
Django==1.10
django-heroku==0.3.1
gast==0.3.3
google-auth==1.28.0
google-auth-oauthlib==0.4.4
google-pasta==0.2.0
grpcio==1.36.1
gunicorn==20.1.0
h5py==2.10.0
idna==2.10
importlib-metadata==3.10.0
joblib==1.0.1
Keras==2.4.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
Markdown==3.3.4
matplotlib==3.4.1
numpy==1.20.2
oauthlib==3.1.0
opt-einsum==3.3.0
pandas==1.1.5
pickle5==0.0.11
Pillow==8.2.0
protobuf==3.15.7
psycopg2==2.8.6
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
PyYAML==5.4.1
requests==2.25.1
requests-oauthlib==1.3.0
rsa==4.7.2
scikit-learn==0.24.1
scipy==1.4.1
seaborn==0.11.1
six==1.15.0
tensorboard==2.2.2
tensorboard-plugin-wit==1.8.0
tensorflow==2.2.0
tensorflow-estimator==2.2.0
termcolor==1.1.0
threadpoolctl==2.1.0
typing-extensions==3.7.4.3
urllib3==1.26.4
Werkzeug==1.0.1
whitenoise==5.2.0
wrapt==1.12.1
zipp==3.4.1
你可以尝试用多种方法来减小弹头大小。最简单的方法是向应用程序中添加一个文件,告诉slug编译器忽略应用程序中任何不必要的文件,例如静态资产

要确定哪些文件/文件夹占用了slug中的空间,您可以启动一个一次性dyno来检查slug,如下所示:

heroku run bash -a <appname>
这有助于确定大文件的位置

您还可能发现,这有助于减少鼻涕虫的大小


在您的案例中,您使用了
tensorflow
scikit-learn
Keras
等。。所有库都非常大。这是您的最佳解决方案。

你好,Riya,欢迎使用StackOverflow,PS:我也有同样的问题。我想这是因为新的git带有用户名和密码。请不要添加文本图像-只需将文本直接放在问题中。感谢您的回复!我试过了,但弹头还是太大了。我想我将不得不dockerize并部署它,或者寻找其他云平台进行部署。@Riya Yes dockerize是AWS平台的最佳选择。请参阅我的最新答案。