question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access denied when downloading facenet_weights.h5 (in docker container)

See original GitHub issue

Hi. I am trying to run a manually created docker image with the usage of deepface. I get:

facenet_weights.h5 will be downloaded...
Access denied with the following error:
        Too many users have viewed or downloaded this file recently. Please
        try accessing the file again later. If the file you are trying to
        access is particularly large or is shared with many people, it may
        take up to 24 hours to be able to view or download the file. If you
        still can't access a file after 24 hours, contact your domain
        administrator.
------------
filename = '/root/.deepface/weights/facenet_weights.h5', file descriptor = 4, errno = 21, error message = 'Is a directory', buf = 0x7fffa32849b0, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0)

I have tried to do a manual download of the model with wget and put it in mentioned above directory. wget -P ~/.deepface/weights https://drive.google.com/uc?id=1971Xk5RwedbudGgTIrGAL4F7Aifu7id1

root@8cdc694b4f5c:/app# ls -la /root/.deepface/weights/
total 12
drwxr-xr-x 3 root root 4096 Mar 20 08:20 .
drwxr-xr-x 3 root root 4096 Mar 20 08:20 ..
drwxr-xr-x 2 root root 4096 Mar 20 08:20 facenet_weights.h5

So it exists in the specified directory. But the app throws the exception again. I have found this link which maybe can useful: https://stackoverflow.com/questions/60739653/gdown-is-giving-permission-error-for-particular-file-although-it-is-opening-up-f

Please help me to figure out if it is not an issue from your side and I am doing smth wrong. Thanks in advance

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aaramgcommented, Mar 20, 2021

Of course. Here is the docker file. Maybe some tuning/optimization can be done here. But this works:

FROM python:3.8-slim-buster
RUN mkdir /app
WORKDIR /app
COPY requirements.txt requirements.txt
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
RUN apt install libgl1-mesa-glx -y
RUN apt-get install 'ffmpeg'\
    'libsm6'\
    'libxext6'  -y
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
RUN mkdir -p /root/.deepface/weights
COPY facenet_weights.h5 /root/.deepface/weights/facenet_weights.h5
COPY . .
CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]

Before building the docker image “facenet_weights.h5” file should be downloaded for example with the browser and put in the project directory to let docker copy it during the building process. P.S.>>“root” is the home path.

0reactions
serengilcommented, Mar 20, 2021

Google Drive has a daily limit and if it exceeded then it is not allowed to download it with out of browsers. That’s why, you cannot download it with gdown but it is still reachable on browsers.

This file always exists in google drive with same link. You can use it forever.

Could you explain how to transfer locally existing files into the docker? This might help some people.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Container permission denied: How to diagnose this error
Learn what is causing a container permissions error and how to work around the issue without resorting to the --privileged flag.
Read more >
How to Fix Docker Permission Denied? - phoenixNAP
Fix Docker Permission Denied error using methods listed in this guide. Start with simple fixes and use the more complex ones if necessary....
Read more >
docker pull container-registry.oracle.com - access denied (or ...
Most of us at times might have got this exceptions access denied and unauthorized while downloading the image using docker pull command.
Read more >
Image Access Management - Docker Documentation
Image Access Management is a new feature that is a part of the Docker Business subscription. ... Download the latest version of Docker...
Read more >
Frequently asked questions - Docker Documentation
When downloading and installing Docker Desktop, you are asked to agree to the Docker Subscription Service Agreement. Read the Blog and FAQs to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found