Ashish-Surve / Comparison_Segmentation_models

Brief comparison of segmentation models. Trained on Collab, served using Fast-API, streamlit and dockerized.

Home Page:https://frontend-seg-models.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to download models

Mansi-1 opened this issue · comments

While starting the docker container, the backend container terminates with the following error:
Traceback (most recent call last): File "main.py", line 17, in <module> import inference File "/app/inference.py", line 31, in <module> modelUnet.load_weights(model_path) File "/usr/local/lib/python3.6/site-packages/keras/engine/saving.py", line 492, in load_wrapper return load_function(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/keras/engine/network.py", line 1221, in load_weights with h5py.File(filepath, mode='r') as f: File "/usr/local/lib/python3.6/site-packages/h5py/_hl/files.py", line 408, in __init__ swmr=swmr) File "/usr/local/lib/python3.6/site-packages/h5py/_hl/files.py", line 173, in make_fid fid = h5f.open(name, flags, fapl=fapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5f.pyx", line 88, in h5py.h5f.open OSError: Unable to open file (file signature not found)

And the UI of the application shows the following error:
ConnectionError: HTTPConnectionPool(host='backend', port=8080): Max retries exceeded with url: /unet (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f81f599ffd0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Am I missing something while starting the conatiner?

It seems like the models haven't been downloaded on your system.
Possible Solutions:

  1. Install Lfs and try to clone again.
  2. Manually download and place the models.

this should help you run the project in one line.

Model wasn't downloaded.
Above recommendations solved the issue.