Docker Community Forums

Share and learn in the Docker community.

File not found(unable to read model)FileNotFoundError: [Errno 2] No such file or directory:

Hi all,

my docker file:
FROM python:3.7.3-slim
RUN pip install --upgrade pip
WORKDIR /app
COPY . /app
RUN pip install requirements.txt
CMD [“python3” , “./predict.py”]

I have build image and container:

sudo docker run -d -p 5000:5000 05b9765a09c4

Then I am running port in postman: it’s throwing the below error:
File “/usr/local/lib/python3.7/site-packages/torch/serialization.py”, line 381, in load
f = open(f, ‘rb’)
FileNotFoundError: [Errno 2] No such file or directory: '/home/welcome/Documents/model/multi_model.pt
predict.py has : modelPath = “/home/welcome/Documents/model/multi_model.pt”