Go5-Project
Go5-Project copied to clipboard
Connection Error When Uploading Image (Mac M1, No GPU)
After uploading sample.jpg, the Streamlit app fails to process the request and services closes the connection unexpectedly. I don't have any GPU and am running this on Mac M1. Here's the error displayed on front-end :
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Traceback:
File "/code/streamlit_app.py", line 154, in <module>
app()
File "/code/streamlit_app.py", line 62, in app
response = requests.request("POST", url, files=files)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 682, in send
raise ConnectionError(err, request=request)
The docker terminal shows this :
[+] Running 3/0
✔ Container go5-project-table_recognition-1 Created 0.0s
✔ Container go5-project-text_recognition-1 Created 0.0s
✔ Container go5-project-streamlit-1 Created 0.0s
Attaching to streamlit-1, table_recognition-1, text_recognition-1
table_recognition-1 |
table_recognition-1 | ==========
text_recognition-1 |
table_recognition-1 | == CUDA ==
text_recognition-1 | ==========
table_recognition-1 | ==========
text_recognition-1 | == CUDA ==
text_recognition-1 | ==========
table_recognition-1 |
table_recognition-1 | CUDA Version 11.6.2
text_recognition-1 |
text_recognition-1 | CUDA Version 11.6.2
text_recognition-1 |
text_recognition-1 | Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
table_recognition-1 |
table_recognition-1 | Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
table_recognition-1 |
table_recognition-1 | This container image and its contents are governed by the NVIDIA Deep Learning Container License.
table_recognition-1 | By pulling and using the container, you accept the terms and conditions of this license:
table_recognition-1 | https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
table_recognition-1 |
table_recognition-1 | A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
text_recognition-1 |
text_recognition-1 | This container image and its contents are governed by the NVIDIA Deep Learning Container License.
text_recognition-1 | By pulling and using the container, you accept the terms and conditions of this license:
text_recognition-1 | https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
text_recognition-1 |
text_recognition-1 | A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
table_recognition-1 |
table_recognition-1 | WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.
table_recognition-1 | Use the NVIDIA Container Toolkit to start this container with GPU support; see
table_recognition-1 | https://docs.nvidia.com/datacenter/cloud-native/ .
table_recognition-1 |
text_recognition-1 |
text_recognition-1 | WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.
text_recognition-1 | Use the NVIDIA Container Toolkit to start this container with GPU support; see
text_recognition-1 | https://docs.nvidia.com/datacenter/cloud-native/ .
text_recognition-1 |
streamlit-1 |
streamlit-1 | Collecting usage statistics. To deactivate, set browser.gatherUsageStats to false.
streamlit-1 |
table_recognition-1 | INFO: Started server process [1]
table_recognition-1 | INFO: Waiting for application startup.
table_recognition-1 | INFO: Application startup complete.
text_recognition-1 | INFO: Started server process [1]
text_recognition-1 | INFO: Waiting for application startup.
text_recognition-1 | INFO: Application startup complete.
text_recognition-1 | INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
table_recognition-1 | INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
streamlit-1 |
streamlit-1 | You can now view your Streamlit app in your browser.
streamlit-1 |
streamlit-1 | Local URL: http://localhost:8501
streamlit-1 | Network URL: http://172.18.0.4:8501
streamlit-1 | External URL: http://223.185.13.146:8501
streamlit-1 |
table_recognition-1 | INFO: 172.18.0.4:48260 - "POST /ai/infer HTTP/1.1" 200 OK
text_recognition-1 | Neither CUDA nor MPS are available - defaulting to CPU. Note: This module is much faster with a GPU.
streamlit-1 | 2025-03-12 07:10:23.017 Uncaught app execution
streamlit-1 | Traceback (most recent call last):
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
streamlit-1 | response = self._make_request(
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 534, in _make_request
streamlit-1 | response = conn.getresponse()
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 516, in getresponse
streamlit-1 | httplib_response = super().getresponse()
streamlit-1 | File "/usr/local/lib/python3.10/http/client.py", line 1375, in getresponse
streamlit-1 | response.begin()
streamlit-1 | File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
streamlit-1 | version, status, reason = self._read_status()
streamlit-1 | File "/usr/local/lib/python3.10/http/client.py", line 287, in _read_status
streamlit-1 | raise RemoteDisconnected("Remote end closed connection without"
streamlit-1 | http.client.RemoteDisconnected: Remote end closed connection without response
streamlit-1 |
streamlit-1 | During handling of the above exception, another exception occurred:
streamlit-1 |
streamlit-1 | Traceback (most recent call last):
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 667, in send
streamlit-1 | resp = conn.urlopen(
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 841, in urlopen
streamlit-1 | retries = retries.increment(
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 474, in increment
streamlit-1 | raise reraise(type(error), error, _stacktrace)
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/util/util.py", line 38, in reraise
streamlit-1 | raise value.with_traceback(tb)
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
streamlit-1 | response = self._make_request(
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 534, in _make_request
streamlit-1 | response = conn.getresponse()
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 516, in getresponse
streamlit-1 | httplib_response = super().getresponse()
streamlit-1 | File "/usr/local/lib/python3.10/http/client.py", line 1375, in getresponse
streamlit-1 | response.begin()
streamlit-1 | File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
streamlit-1 | version, status, reason = self._read_status()
streamlit-1 | File "/usr/local/lib/python3.10/http/client.py", line 287, in _read_status
streamlit-1 | raise RemoteDisconnected("Remote end closed connection without"
streamlit-1 | urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
streamlit-1 |
streamlit-1 | During handling of the above exception, another exception occurred:
streamlit-1 |
streamlit-1 | Traceback (most recent call last):
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 121, in exec_func_with_error_handling
streamlit-1 | result = func()
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 593, in code_to_exec
streamlit-1 | exec(code, module.__dict__)
streamlit-1 | File "/code/streamlit_app.py", line 154, in <module>
streamlit-1 | app()
streamlit-1 | File "/code/streamlit_app.py", line 62, in app
streamlit-1 | response = requests.request("POST", url, files=files)
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
streamlit-1 | return session.request(method=method, url=url, **kwargs)
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
streamlit-1 | resp = self.send(prep, **send_kwargs)
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
streamlit-1 | r = adapter.send(request, **kwargs)
streamlit-1 | File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 682, in send
streamlit-1 | raise ConnectionError(err, request=request)
streamlit-1 | requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
text_recognition-1 exited with code 0
text_recognition-1 | INFO: Started server process [1]
text_recognition-1 | INFO: Waiting for application startup.
text_recognition-1 | INFO: Application startup complete.
text_recognition-1 | INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
table_recognition-1 | INFO: 172.18.0.4:49408 - "POST /ai/infer HTTP/1.1" 422 Unprocessable Entity