Please I have been able to deploy my app on the google cloud console but the app can’t read the directories to the model, pictures, and dataset.
I first get this error pop up:
Connection failed with status 404, and response "<!DOCTYPE html> <html lang=en> <meta charset=utf-8> <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"> <title>Error 404 (Not Found)!!1</title> <style> *
After closing this pop up
FileNotFoundError: [Errno 2] No such file or directory: 'banner.PNG'
Traceback:
File "/usr/local/lib/python3.8/site-packages/streamlit/script_runner.py", line 354, in _run_script
exec(code, module.__dict__)
File "/app/app.py", line 338, in <module>
main()
File "/app/app.py", line 204, in main
st.image(load_image('banner.PNG'))
File "/usr/local/lib/python3.8/site-packages/streamlit/legacy_caching/caching.py", line 543, in wrapped_func
return get_or_create_cached_value()
File "/usr/local/lib/python3.8/site-packages/streamlit/legacy_caching/caching.py", line 527, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "/app/app.py", line 189, in load_image
im =Image.open(os.path.join(img))
File "/usr/local/lib/python3.8/site-packages/PIL/Image.py", line 2968, in open
fp = builtins.open(filename, "rb")
my app.yaml contains:
runtime: custom
env: flex
This is my Docker file
# Base image of python 3.8
FROM python:3.8
# Setup the working directory
WORKDIR /app
# Copy files from the current directory to the working directory
COPY . /app
# Install all the dependencies for the app
RUN pip install -r requirements.txt
# Expose port 8080 of the container for listening
EXPOSE 8080
# The command to launch streamlit app and expose it's port 8080, when container is up and running
CMD streamlit run app.py --server.port=8080