avatarify-python icon indicating copy to clipboard operation
avatarify-python copied to clipboard

Trying to build docker image, fails on step 10/14

Open larstr opened this issue 4 years ago • 5 comments

Hi, I'm trying to build the docker image, but it keeps failing. I did the following:

git clone https://github.com/alievk/avatarify.git
cd avatarify
bash scripts/install_docker.sh 
sudo docker start
sudo docker build -t avatarify .

I'm running Ubuntu 18.04 and have a GPU 0: Quadro M2200 (UUID: GPU-5e398c6f-cf5d-6f56-159b-66b8b45fd6c7)

The output from the build is as follows:

(base) lars@ThinkPad-P:~/Downloads/avatarify$ sudo docker build -t avatarify .
Sending build context to Docker daemon  12.53MB
Step 1/14 : FROM nvcr.io/nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04
 ---> a9fac7264a6d
Step 2/14 : RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update  && DEBIAN_FRONTEND=noninteractive apt-get -qqy install curl python3-pip python3-tk ffmpeg git less nano libsm6 libxext6 libxrender-dev  && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> dc03d32989aa
Step 3/14 : ARG PYTORCH_WHEEL="https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl"
 ---> Using cache
 ---> f97c097b2a89
Step 4/14 : ARG FACE_ALIGNMENT_GIT="git+https://github.com/1adrianb/face-alignment"
 ---> Using cache
 ---> e2ec2da1480f
Step 5/14 : ARG AVATARIFY_COMMIT="v0.1-docker"
 ---> Using cache
 ---> f3d9cb7f2281
Step 6/14 : ARG FOMM_COMMIT="efbe0a6f17b38360ff9a446fddfbb3ce5493534c"
 ---> Using cache
 ---> 1995fde50e17
Step 7/14 : RUN git clone https://github.com/alievk/avatarify.git /app/avatarify && cd /app/avatarify && git checkout ${AVATARIFY_COMMIT}  && git clone https://github.com/alievk/first-order-model.git /app/avatarify/fomm && cd /app/avatarify/fomm && git checkout ${FOMM_COMMIT}
 ---> Using cache
 ---> 5bec72564f48
Step 8/14 : WORKDIR /app/avatarify
 ---> Using cache
 ---> 68ef7bcb65e7
Step 9/14 : RUN bash scripts/download_data.sh
 ---> Using cache
 ---> 36a93c845b21
Step 10/14 : RUN pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r requirements.txt  && pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r fomm/requirements.txt  && rm -rf /root/.cache/pip
 ---> Running in 800f66c678cb
Collecting git+https://github.com/1adrianb/face-alignment
  Cloning https://github.com/1adrianb/face-alignment to /tmp/pip-egah7qrz-build
Collecting torch==1.0.0 from https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl
  Downloading https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl (753.6MB)
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/usr/lib/python3/dist-packages/pip/download.py", line 663, in unpack_http_url
    unpack_file(from_path, location, content_type, link)
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 617, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 502, in unzip_file
    zip = zipfile.ZipFile(zipfp, allowZip64=True)
  File "/usr/lib/python3.6/zipfile.py", line 1131, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.6/zipfile.py", line 1198, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
The command '/bin/sh -c pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r requirements.txt  && pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r fomm/requirements.txt  && rm -rf /root/.cache/pip' returned a non-zero code: 2
(base) lars@ThinkPad-P:~/Downloads/avatarify$ 

larstr avatar Aug 20 '20 05:08 larstr

I also ran into this on my Mac

...
Step 10/14 : RUN pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r requirements.txt  && pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r fomm/requirements.txt  && rm -rf /root/.cache/pip
 ---> Running in ffc165b71371
Collecting git+https://github.com/1adrianb/face-alignment
  Cloning https://github.com/1adrianb/face-alignment to /tmp/pip-1rxjxo7i-build
Collecting torch==1.0.0 from https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl
  Downloading https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl (753.6MB)
Killed
The command '/bin/sh -c pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r requirements.txt  && pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r fomm/requirements.txt  && rm -rf /root/.cache/pip' returned a non-zero code: 137

It would be awesome if there was an image on docker hub that we could just pull.

willfarrell avatar Sep 07 '20 19:09 willfarrell

From the error description, it seems it failed to download a file. Anyway, you should try to run docker without sudo.

cserpell avatar Sep 10 '20 19:09 cserpell

@willfarrell On Mac it is impossible to run a Linux Docker (it is also using nvidia docker). Probably a problem when installing the linux version of pytorch. Docker is only for Linux available atm. @larstr I don't really know what's happening. Could you try adding yourself to the Docker group (sudo usermod -aG docker username where you replace username with your username) and then run just docker build -t avatarify?

mintmaker avatar Sep 12 '20 11:09 mintmaker

Fixed the formatting to make your console log readable.

Could you please try again with the latest master from git?

JohanAR avatar Jan 13 '21 10:01 JohanAR

It still fails; now with the error: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hq0q4oxd/numba/ The command '/bin/sh -c pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r requirements.txt && pip3 install ${PYTORCH_WHEEL} ${FACE_ALIGNMENT_GIT} -r fomm/requirements.txt && rm -rf /root/.cache/pip' returned a non-zero code: 1

larstr avatar Jan 14 '21 00:01 larstr