Okay, I’ve worked out the installation now (or I think because the packages downloaded without errors).
Here is my requirements.txt file:
Flask
gunicorn
numpy
https://download.pytorch.org/whl/cpu/torch-1.0.0-cp36-cp36m-linux_x86_64.whl
fastai
But I now encounter new problems. When I tried to open the app, it gave me an error response. I am still trying to get around with the water classifier app.
Here is my command line history. If anyone can help me again, that will be greatly appreciated.
(base) jfang@jfang-workstation:~$ heroku logs --app water-classification-exp
2020-02-14T17:50:15.560112+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2020-02-14T17:50:15.560113+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-02-14T17:50:15.560113+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-02-14T17:50:15.560113+00:00 app[web.1]: File "/app/app.py", line 13, in <module>
2020-02-14T17:50:15.560114+00:00 app[web.1]: from fastai.vision import *
2020-02-14T17:50:15.560114+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/fastai/vision/__init__.py", line 3, in <module>
2020-02-14T17:50:15.560114+00:00 app[web.1]: from .learner import *
2020-02-14T17:50:15.560114+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/fastai/vision/learner.py", line 6, in <module>
2020-02-14T17:50:15.560115+00:00 app[web.1]: from . import models
2020-02-14T17:50:15.560115+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/fastai/vision/models/__init__.py", line 2, in <module>
2020-02-14T17:50:15.560115+00:00 app[web.1]: from torchvision.models import ResNet,resnet18,resnet34,resnet50,resnet101,resnet152
2020-02-14T17:50:15.560115+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/torchvision/__init__.py", line 3, in <module>
2020-02-14T17:50:15.560116+00:00 app[web.1]: from torchvision import models
2020-02-14T17:50:15.560116+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/torchvision/models/__init__.py", line 5, in <module>
2020-02-14T17:50:15.560116+00:00 app[web.1]: from .inception import *
2020-02-14T17:50:15.560116+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/torchvision/models/inception.py", line 8, in <module>
2020-02-14T17:50:15.560117+00:00 app[web.1]: from torch.jit.annotations import Optional
2020-02-14T17:50:15.560117+00:00 app[web.1]: ImportError: cannot import name 'Optional'
2020-02-14T17:50:15.560118+00:00 app[web.1]: [2020-02-14 17:50:15 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-02-14T17:50:16.018758+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=water-classification-exp.herokuapp.com request_id=743451b5-517a-439e-8e36-c8bc01fbebc3 fwd="73.154.95.209" dyno=web.1 connect=1ms service=1609ms status=503 bytes=0 protocol=https
2020-02-14T17:50:16.018866+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=water-classification-exp.herokuapp.com request_id=0b4dbac4-4735-448d-81ae-5114c0bb832e fwd="73.154.95.209" dyno=web.1 connect=1ms service=2480ms status=503 bytes=0 protocol=https
2020-02-14T17:50:15.924321+00:00 app[web.1]: [2020-02-14 17:50:15 +0000] [11] [ERROR] Exception in worker process
2020-02-14T17:50:15.924329+00:00 app[web.1]: Traceback (most recent call last):
2020-02-14T17:50:15.924330+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-02-14T17:50:15.924330+00:00 app[web.1]: worker.init_process()
2020-02-14T17:50:15.924331+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process
2020-02-14T17:50:15.924331+00:00 app[web.1]: self.load_wsgi()
2020-02-14T17:50:15.924334+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2020-02-14T17:50:15.924334+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-02-14T17:50:15.924335+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-02-14T17:50:15.924335+00:00 app[web.1]: self.callable = self.load()
2020-02-14T17:50:15.924336+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2020-02-14T17:50:15.924336+00:00 app[web.1]: return self.load_wsgiapp()
2020-02-14T17:50:15.924336+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2020-02-14T17:50:15.924337+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-02-14T17:50:15.924337+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app
2020-02-14T17:50:15.924338+00:00 app[web.1]: mod = importlib.import_module(module)
2020-02-14T17:50:15.924338+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
2020-02-14T17:50:15.924338+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-02-14T17:50:15.924339+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2020-02-14T17:50:15.924341+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2020-02-14T17:50:15.924341+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2020-02-14T17:50:15.924342+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2020-02-14T17:50:15.924342+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-02-14T17:50:15.924342+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-02-14T17:50:15.924343+00:00 app[web.1]: File "/app/app.py", line 13, in <module>
2020-02-14T17:50:15.924343+00:00 app[web.1]: from fastai.vision import *
2020-02-14T17:50:15.924344+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/fastai/vision/__init__.py", line 3, in <module>
2020-02-14T17:50:15.924344+00:00 app[web.1]: from .learner import *
2020-02-14T17:50:15.924344+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/fastai/vision/learner.py", line 6, in <module>
2020-02-14T17:50:15.924345+00:00 app[web.1]: from . import models
2020-02-14T17:50:15.924345+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/fastai/vision/models/__init__.py", line 2, in <module>
2020-02-14T17:50:15.924345+00:00 app[web.1]: from torchvision.models import ResNet,resnet18,resnet34,resnet50,resnet101,resnet152
2020-02-14T17:50:15.924346+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/torchvision/__init__.py", line 3, in <module>
2020-02-14T17:50:15.924346+00:00 app[web.1]: from torchvision import models
2020-02-14T17:50:15.924347+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/torchvision/models/__init__.py", line 5, in <module>
2020-02-14T17:50:15.924347+00:00 app[web.1]: from .inception import *
2020-02-14T17:50:15.924348+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/torchvision/models/inception.py", line 8, in <module>
2020-02-14T17:50:15.924348+00:00 app[web.1]: from torch.jit.annotations import Optional
2020-02-14T17:50:15.924348+00:00 app[web.1]: ImportError: cannot import name 'Optional'
2020-02-14T17:50:15.924863+00:00 app[web.1]: [2020-02-14 17:50:15 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-02-14T17:50:16.120527+00:00 app[web.1]: Traceback (most recent call last):
2020-02-14T17:50:16.120536+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 209, in run
2020-02-14T17:50:16.121021+00:00 app[web.1]: self.sleep()
2020-02-14T17:50:16.121026+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 357, in sleep
2020-02-14T17:50:16.121409+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0)
2020-02-14T17:50:16.121412+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2020-02-14T17:50:16.121741+00:00 app[web.1]: self.reap_workers()
2020-02-14T17:50:16.121746+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2020-02-14T17:50:16.122229+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2020-02-14T17:50:16.122278+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2020-02-14T17:50:16.122279+00:00 app[web.1]:
2020-02-14T17:50:16.122279+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2020-02-14T17:50:16.122279+00:00 app[web.1]:
2020-02-14T17:50:16.122286+00:00 app[web.1]: Traceback (most recent call last):
2020-02-14T17:50:16.122306+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2020-02-14T17:50:16.122485+00:00 app[web.1]: sys.exit(run())
2020-02-14T17:50:16.122486+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
2020-02-14T17:50:16.122690+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2020-02-14T17:50:16.122690+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 228, in run
2020-02-14T17:50:16.122999+00:00 app[web.1]: super().run()
2020-02-14T17:50:16.123000+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2020-02-14T17:50:16.123199+00:00 app[web.1]: Arbiter(self).run()
2020-02-14T17:50:16.123219+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 229, in run
2020-02-14T17:50:16.123487+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2020-02-14T17:50:16.123488+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 342, in halt
2020-02-14T17:50:16.123868+00:00 app[web.1]: self.stop()
2020-02-14T17:50:16.123869+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
2020-02-14T17:50:16.124294+00:00 app[web.1]: time.sleep(0.1)
2020-02-14T17:50:16.124299+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2020-02-14T17:50:16.124597+00:00 app[web.1]: self.reap_workers()
2020-02-14T17:50:16.124602+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2020-02-14T17:50:16.125062+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2020-02-14T17:50:16.125095+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2020-02-14T17:50:16.225835+00:00 heroku[web.1]: State changed from up to crashed
2020-02-14T17:50:16.203119+00:00 heroku[web.1]: Process exited with status 1
2020-02-14T17:50:21.316644+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=water-classification-exp.herokuapp.com request_id=d58bbadd-5790-4ca2-b7e9-299cfa3b0092 fwd="73.154.95.209" dyno=web.1 connect=5001ms service= status=503 bytes= protocol=https
2020-02-14T17:50:32.000000+00:00 app[api]: Build succeeded
2020-02-14T17:53:00.265375+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=water-classification-exp.herokuapp.com request_id=e407c83d-5161-447b-b000-3ff22bcf81b5 fwd="73.154.95.209" dyno= connect= service= status=503 bytes= protocol=https
2020-02-14T17:53:00.575875+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=water-classification-exp.herokuapp.com request_id=9ee7f427-17fb-4caf-99db-fbe272eff3df fwd="73.154.95.209" dyno= connect= service= status=503 bytes= protocol=https
(base) jfang@jfang-workstation:~$