-
-
Save xenogenesi/e62d3d13dadbc164124c830e9c453668 to your computer and use it in GitHub Desktop.
# Ignore everything | |
** | |
# Allow files and directories | |
!/audio.py | |
!/Dockerfile | |
!/hparams.py | |
!/preprocess.py | |
!/checkpoints/ | |
!/evaluation/ | |
!/hq_wav2lip_train.py | |
!/README.md | |
!/temp/ | |
!/color_syncnet_train.py | |
!/face_detection/ | |
!/inference.py | |
!/requirements.txt | |
!/filelists/ | |
!/models/ | |
!/results/ | |
!/wav2lip_train.py | |
# Ignore unnecessary files inside allowed directories | |
# This should go after the allowed directories | |
**/*~ | |
**/*.log | |
**/.DS_Store | |
**/Thumbs.db |
# 1. install a version of docker with gpu support (docker-ce >= 19.03) | |
# 2. enter the project directory and build the wav2lip image: | |
# docker build -t wav2lip . | |
# 3. allow root user to connect to the display | |
# xhost +local:root | |
# 4. instantiate the container | |
# docker run --rm --gpus all -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/workspace/src -e DISPLAY=$DISPLAY --device /dev/dri -ti wav2lip bash | |
# NOTES: | |
# export CUDA_VISIBLE_DEVICES="" ## force cpu only | |
# Based on https://github.com/1adrianb/face-alignment/blob/master/Dockerfile | |
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 | |
RUN export DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 ; \ | |
apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential cmake git curl ca-certificates \ | |
vim \ | |
python3-pip python3-dev python3-wheel \ | |
libglib2.0-0 libxrender1 python3-soundfile \ | |
ffmpeg && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
pip3 install --upgrade setuptools | |
# RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | |
# chmod +x ~/miniconda.sh && \ | |
# ~/miniconda.sh -b -p /opt/conda && \ | |
# rm ~/miniconda.sh | |
# ENV PATH /opt/conda/bin:$PATH | |
# RUN conda config --set always_yes yes --set changeps1 no && conda update -q conda | |
# RUN conda install pytorch torchvision cudatoolkit=10.1 -c pytorch | |
# # Install Wav2Lip package | |
# # NOTE we use the git clone to install the requirements only once | |
# # (if we use COPY it will invalidate the cache and reinstall the dependencies for every change in the sources) | |
WORKDIR /workspace | |
RUN chmod -R a+w /workspace | |
RUN git clone https://github.com/Rudrabha/Wav2Lip | |
WORKDIR /workspace/Wav2Lip | |
RUN pip3 install -r requirements.txt | |
RUN mkdir -p /root/.cache/torch/checkpoints && \ | |
curl -SL -o /root/.cache/torch/checkpoints/s3fd-619a316812.pth "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth" | |
# !!! NOTE !!! nvidia-driver version must match the version installed on the host(/docker server) | |
RUN export DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 ; \ | |
apt-get update && apt-get install -y --no-install-recommends \ | |
nvidia-driver-450 mesa-utils && \ | |
rm -rf /var/lib/apt/lists/* | |
# create the working directory, to be mounted with the bind option | |
RUN mkdir /workspace/src | |
WORKDIR /workspace/src |
errors
conda-4.10.3-p 100% |###############################| Time: 0:00:01 2.18 MB/s0 B/s
113.8 Traceback (most recent call last):
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1079, in __call__
113.8 return func(*args, **kwargs)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
113.8 exit_code = do_call(args, p)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
113.8 return getattr(module, func_name)(args, parser)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_clean.py", line 288, in execute
113.8 json_result = _execute(args, parser)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_clean.py", line 240, in _execute
113.8 pkgs_dirs, totalsize = find_tarballs()
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_clean.py", line 20, in find_tarballs
113.8 from ..core.package_cache_data import PackageCacheData
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/core/package_cache_data.py", line 14, in <module>
113.8 from .path_actions import CacheUrlAction, ExtractPackageAction
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/core/path_actions.py", line 30, in <module>
113.8 from ..gateways.connection.download import download
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/gateways/connection/__init__.py", line 21, in <module>
113.8 from requests import ConnectionError, HTTPError, Session
113.8 File "/opt/conda/lib/python3.6/site-packages/requests/__init__.py", line 84, in <module>
113.8 from urllib3.contrib import pyopenssl
113.8 File "/opt/conda/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
113.8 import OpenSSL.SSL
113.8 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/__init__.py", line 8, in <module>
113.8 from OpenSSL import rand, crypto, SSL
113.8 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/rand.py", line 169, in <module>
113.8 _lib.ERR_load_RAND_strings()
113.8 AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings'
113.8
113.8 During handling of the above exception, another exception occurred:
113.8
113.8 Traceback (most recent call last):
113.8 File "/opt/conda/bin/conda", line 13, in <module>
113.8 sys.exit(main())
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main.py", line 152, in main
113.8 return conda_exception_handler(_main, *args, **kwargs)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1371, in conda_exception_handler
113.8 return_value = exception_handler(func, *args, **kwargs)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1082, in __call__
113.8 return self.handle_exception(exc_val, exc_tb)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1126, in handle_exception
113.8 return self.handle_unexpected_exception(exc_val, exc_tb)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1137, in handle_unexpected_exception
113.8 self.print_unexpected_error_report(error_report)
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1207, in print_unexpected_error_report
113.8 from .cli.main_info import get_env_vars_str, get_main_info_str
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_info.py", line 19, in <module>
113.8 from ..core.index import _supplement_index_with_system
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/core/index.py", line 13, in <module>
113.8 from .package_cache_data import PackageCacheData
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/core/package_cache_data.py", line 14, in <module>
113.8 from .path_actions import CacheUrlAction, ExtractPackageAction
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/core/path_actions.py", line 30, in <module>
113.8 from ..gateways.connection.download import download
113.8 File "/opt/conda/lib/python3.6/site-packages/conda/gateways/connection/__init__.py", line 21, in <module>
113.8 from requests import ConnectionError, HTTPError, Session
113.8 File "/opt/conda/lib/python3.6/site-packages/requests/__init__.py", line 84, in <module>
113.8 from urllib3.contrib import pyopenssl
113.8 File "/opt/conda/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
113.8 import OpenSSL.SSL
113.8 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/__init__.py", line 8, in <module>
113.8 from OpenSSL import rand, crypto, SSL
113.8 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/rand.py", line 169, in <module>
113.8 _lib.ERR_load_RAND_strings()
113.8 AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings'
------
1 warning found (use docker --debug to expand):
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 35)
Dockerfile:28
--------------------
27 |
28 | >>> RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh && \
29 | >>> chmod +x ~/miniconda.sh && \
30 | >>> ~/miniconda.sh -b -p /opt/conda && \
31 | >>> rm ~/miniconda.sh && \
32 | >>> /opt/conda/bin/conda install -y python=3.6 && \
33 | >>> /opt/conda/bin/conda clean -ya
34 |
--------------------
ERROR: failed to solve: process "/bin/sh -c curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh && chmod +x ~/miniconda.sh && ~/miniconda.sh -b -p /opt/conda && rm ~/miniconda.sh && /opt/conda/bin/conda install -y python=3.6 && /opt/conda/bin/conda clean -ya" did not complete successfully: exit code: 1
@xenogenesi So line 28
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh && \
chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda install -y python=3.6 && \
/opt/conda/bin/conda clean -ya
ENV PATH /opt/conda/bin:$PATH
@vido89 gpt says is a library version problem and propose some solution (I don't know if this is really the problem, seems legit but ...)
That error is caused by an OpenSSL compatibility issue. Python 3.6 relies on older OpenSSL APIs that have been removed in OpenSSL 3.x, which ships with Ubuntu 24.04. Specifically, ERR_load_RAND_strings was removed in OpenSSL 3.0.
Option 2: Install OpenSSL 1.1.1 alongside OpenSSL 3.x
Manually install OpenSSL 1.1.1 and make Python 3.6 use it
add libssl1.1
to the apt-get installed packages install -y wget bzip2 build-essential libssl1.1
set LD_LIBRARY_PATH to use it
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:$LD_LIBRARY_PATH
ENV PATH="/opt/conda/bin:$PATH"
and check it is using it
RUN python --version && python -c "import ssl; print(ssl.OPENSSL_VERSION)"
but, this could be the first of many issues given by the old conda/python3.6 environment installing on a recent ubuntu release ...
@xenogenesi Ok I placed install -y wget bzip2 build-essential libssl1.1
on line 20
where should I put
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:$LD_LIBRARY_PATH
ENV PATH="/opt/conda/bin:$PATH"
In Docker on in /home/slobodan/~/.bashrc ?
Edit:
48.11 Reading package lists...
49.16 Reading package lists...
50.09 Building dependency tree...
50.28 Reading state information...
50.36 E: Unable to locate package libssl1.1
50.36 E: Couldn't find any package by glob 'libssl1.1'
50.36 E: Couldn't find any package by regex 'libssl1.1'
@vido89 in the Dockerfile where there was ENV PATH "/opt/conda/bin:$PATH"
can you update your fork with your latest Dockerfile so I can see it? Or attach it here? You can use the details
tag in the markdown to make it clickable and avoid long messages
<details>
<summary>content name</summary>
raw content
</details>
content name
raw contentOk here it is
MyDockerfile
# 1. install a version of docker with gpu support (docker-ce >= 19.03)
# 2. enter the project directory and build the wav2lip image:
# docker build -t wav2lip .
# 3. allow root user to connect to the display
# xhost +local:root
# 4. instantiate the container
# docker run --rm --gpus all -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/workspace/src -e DISPLAY=$DISPLAY --device /dev/dri -ti wav2lip bash
# NOTES:
# export CUDA_VISIBLE_DEVICES="" ## force cpu only
# Based on https://github.com/1adrianb/face-alignment/blob/master/Dockerfile
FROM nvidia/cuda:12.2.0-base-ubuntu22.04
RUN export DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 ; \
apt-get update && apt-get install -y wget bzip2 build-essential libssl1.1 --no-install-recommends \
build-essential cmake git curl ca-certificates \
vim \
libglib2.0-0 libxrender1 python3-soundfile \
ffmpeg && \
rm -rf /var/lib/apt/lists/*
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh && \
chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda install -y python=3.6 && \
/opt/conda/bin/conda clean -ya
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:$LD_LIBRARY_PATH
ENV PATH="/opt/conda/bin:$PATH"
# RUN conda config --set always_yes yes --set changeps1 no && conda update -q conda
# Verify Python version
RUN python --version
RUN conda config --set always_yes yes --set changeps1 no && conda update -q conda
# RUN conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
# # Install Wav2Lip package
# # NOTE we use the git clone to install the requirements only once
# # (if we use COPY it will invalidate the cache and reinstall the dependencies for every change in the sources)
WORKDIR /workspace
RUN chmod -R a+w /workspace
RUN git clone https://github.com/Rudrabha/Wav2Lip
WORKDIR /workspace/Wav2Lip
RUN pip3 install --upgrade pip
RUN pip3 install --upgrade setuptools
RUN pip3 install -r requirements.txt
RUN mkdir -p /root/.cache/torch/checkpoints && \
curl -SL -o /root/.cache/torch/checkpoints/s3fd-619a316812.pth "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth"
# !!! NOTE !!! nvidia-driver version must match the version installed on the host(/docker server)
RUN export DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 ; \
apt-get update && apt-get install -y --no-install-recommends \
nvidia-driver-550 mesa-utils && \
rm -rf /var/lib/apt/lists/*
# create the working directory, to be mounted with the bind option
RUN mkdir /workspace/src
WORKDIR /workspace/src
@vido89 yeah, I thought this could happen, must be an ancient package
48.11 Reading package lists...
49.16 Reading package lists...
50.09 Building dependency tree...
50.28 Reading state information...
50.36 E: Unable to locate package libssl1.1
50.36 E: Couldn't find any package by glob 'libssl1.1'
50.36 E: Couldn't find any package by regex 'libssl1.1'
I have it installed in my debian but is not available anymore
$ apt-show-versions -a libssl1.1
libssl1.1:amd64 1.1.1o-1 install ok installed
No stable version
No unstable version
No experimental version
libssl1.1:amd64 1.1.1o-1 installed: No available version in archive
/usr/lib/x86_64-linux-gnu/engines-1.1/afalg.so
/usr/lib/x86_64-linux-gnu/engines-1.1/padlock.so
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
/usr/lib/x86_64-linux-gnu/libssl.so.1.1
/usr/share/doc/libssl1.1/NEWS.Debian.gz
/usr/share/doc/libssl1.1/changelog.Debian.gz
/usr/share/doc/libssl1.1/changelog.gz
/usr/share/doc/libssl1.1/copyright
perhaps downloading and installing the deb version from some repo?
Ok I added echo "deb http://archive.ubuntu.com/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/focal.list
to be able to install libssl1.1 and I installed it on host but Decker can't find it
@vido89 No, you need to install it within the Dockerfile not on the host, remove it, use RUN, and I think you might want to move the line
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:$LD_LIBRARY_PATH
before the RUN curl ...
, which is where the python installation fail
recap:
-
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:$LD_LIBRARY_PATH
-
RUN download and install libssl
-
RUN curl ...
@xenogenesi So I need it only on host or in docker too the libssl1.1?
@xenogenesi So I need it only on host or in docker too the libssl1.1?
You don't need it in your system, but the running docker image/python3.6 need it, add a RUN line in the Dockerfile with a command from that gist above that download and install it within the docker image
@xenogenesi
Ok
- moved
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:$LD_LIBRARY_PATH
on line 27
I need help on the 2nd step how command should look like to download libssl1.1 in side of docker
and what's
3rd RUN curl ?
Edit: that gist use wget which is not available in my docker the wget, we tried it before
@vido89 ok, the command should look something like this:
RUN cd /tmp && wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb
this should leave your docker image with libssl1.1 installed (I just checked and the url is still working)
by RUN curl ...
I mean then proceed with our installation of conda/python3.6 RUN curl -o ~/miniconda.sh -O ...
etc etc
Ok I'm having this error now
Error
conda-4.10.3-p 100% |###############################| Time: 0:00:02 1.57 MB/s0 B/s
171.7 Traceback (most recent call last):
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1079, in __call__
171.7 return func(*args, **kwargs)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
171.7 exit_code = do_call(args, p)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
171.7 return getattr(module, func_name)(args, parser)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_clean.py", line 288, in execute
171.7 json_result = _execute(args, parser)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_clean.py", line 240, in _execute
171.7 pkgs_dirs, totalsize = find_tarballs()
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_clean.py", line 20, in find_tarballs
171.7 from ..core.package_cache_data import PackageCacheData
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/core/package_cache_data.py", line 14, in <module>
171.7 from .path_actions import CacheUrlAction, ExtractPackageAction
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/core/path_actions.py", line 30, in <module>
171.7 from ..gateways.connection.download import download
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/gateways/connection/__init__.py", line 21, in <module>
171.7 from requests import ConnectionError, HTTPError, Session
171.7 File "/opt/conda/lib/python3.6/site-packages/requests/__init__.py", line 84, in <module>
171.7 from urllib3.contrib import pyopenssl
171.7 File "/opt/conda/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
171.7 import OpenSSL.SSL
171.7 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/__init__.py", line 8, in <module>
171.7 from OpenSSL import rand, crypto, SSL
171.7 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/rand.py", line 169, in <module>
171.7 _lib.ERR_load_RAND_strings()
171.7 AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings'
171.7
171.7 During handling of the above exception, another exception occurred:
171.7
171.7 Traceback (most recent call last):
171.7 File "/opt/conda/bin/conda", line 13, in <module>
171.7 sys.exit(main())
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main.py", line 152, in main
171.7 return conda_exception_handler(_main, *args, **kwargs)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1371, in conda_exception_handler
171.7 return_value = exception_handler(func, *args, **kwargs)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1082, in __call__
171.7 return self.handle_exception(exc_val, exc_tb)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1126, in handle_exception
171.7 return self.handle_unexpected_exception(exc_val, exc_tb)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1137, in handle_unexpected_exception
171.7 self.print_unexpected_error_report(error_report)
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/exceptions.py", line 1207, in print_unexpected_error_report
171.7 from .cli.main_info import get_env_vars_str, get_main_info_str
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/cli/main_info.py", line 19, in <module>
171.7 from ..core.index import _supplement_index_with_system
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/core/index.py", line 13, in <module>
171.7 from .package_cache_data import PackageCacheData
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/core/package_cache_data.py", line 14, in <module>
171.7 from .path_actions import CacheUrlAction, ExtractPackageAction
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/core/path_actions.py", line 30, in <module>
171.7 from ..gateways.connection.download import download
171.7 File "/opt/conda/lib/python3.6/site-packages/conda/gateways/connection/__init__.py", line 21, in <module>
171.7 from requests import ConnectionError, HTTPError, Session
171.7 File "/opt/conda/lib/python3.6/site-packages/requests/__init__.py", line 84, in <module>
171.7 from urllib3.contrib import pyopenssl
171.7 File "/opt/conda/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
171.7 import OpenSSL.SSL
171.7 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/__init__.py", line 8, in <module>
171.7 from OpenSSL import rand, crypto, SSL
171.7 File "/opt/conda/lib/python3.6/site-packages/OpenSSL/rand.py", line 169, in <module>
171.7 _lib.ERR_load_RAND_strings()
171.7 AttributeError: module 'lib' has no attribute 'ERR_load_RAND_strings'
------
Dockerfile:31
--------------------
30 |
31 | >>> RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh && \
32 | >>> chmod +x ~/miniconda.sh && \
33 | >>> ~/miniconda.sh -b -p /opt/conda && \
34 | >>> rm ~/miniconda.sh && \
35 | >>> /opt/conda/bin/conda install -y python=3.6 && \
36 | >>> /opt/conda/bin/conda clean -ya
37 | RUN python --version && python -c "import ssl; print(ssl.OPENSSL_VERSION)"
--------------------
ERROR: failed to solve: process "/bin/sh -c curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh && chmod +x ~/miniconda.sh && ~/miniconda.sh -b -p /opt/conda && rm ~/miniconda.sh && /opt/conda/bin/conda install -y python=3.6 && /opt/conda/bin/conda clean -ya" did not complete successfully: exit code: 1
and to be clear hire is my Dockerfile
Dockerfile
# 1. install a version of docker with gpu support (docker-ce >= 19.03)
# 2. enter the project directory and build the wav2lip image:
# docker build -t wav2lip .
# 3. allow root user to connect to the display
# xhost +local:root
# 4. instantiate the container
# docker run --rm --gpus all -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/workspace/src -e DISPLAY=$DISPLAY --device /dev/dri -ti wav2lip bash
# NOTES:
# export CUDA_VISIBLE_DEVICES="" ## force cpu only
# Based on https://github.com/1adrianb/face-alignment/blob/master/Dockerfile
FROM nvidia/cuda:12.2.0-base-ubuntu22.04
RUN export DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 ; \
apt-get update && apt-get install -y wget --no-install-recommends \
build-essential cmake git curl ca-certificates \
vim \
libglib2.0-0 libxrender1 python3-soundfile \
ffmpeg && \
rm -rf /var/lib/apt/lists/*
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/conda/lib:$LD_LIBRARY_PATH
RUN cd /tmp && wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh && \
chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda install -y python=3.6 && \
/opt/conda/bin/conda clean -ya
RUN python --version && python -c "import ssl; print(ssl.OPENSSL_VERSION)"
ENV PATH="/opt/conda/bin:$PATH"
# RUN conda config --set always_yes yes --set changeps1 no && conda update -q conda
# Verify Python version
RUN python --version
RUN conda config --set always_yes yes --set changeps1 no && conda update -q conda
# RUN conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
# # Install Wav2Lip package
# # NOTE we use the git clone to install the requirements only once
# # (if we use COPY it will invalidate the cache and reinstall the dependencies for every change in the sources)
WORKDIR /workspace
RUN chmod -R a+w /workspace
RUN git clone https://github.com/Rudrabha/Wav2Lip
WORKDIR /workspace/Wav2Lip
RUN pip3 install --upgrade pip
RUN pip3 install --upgrade setuptools
RUN pip3 install -r requirements.txt
RUN mkdir -p /root/.cache/torch/checkpoints && \
curl -SL -o /root/.cache/torch/checkpoints/s3fd-619a316812.pth "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth"
# !!! NOTE !!! nvidia-driver version must match the version installed on the host(/docker server)
RUN export DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 ; \
apt-get update && apt-get install -y --no-install-recommends \
nvidia-driver-550 mesa-utils && \
rm -rf /var/lib/apt/lists/*
# create the working directory, to be mounted with the bind option
RUN mkdir /workspace/src
WORKDIR /workspace/src
Ok I'm having this error now
great, that's the same error as before, installing libssl1.1 solved nothing, the Dockerfile looks fine
update
You know, the symbol still exists on openssl 3 I wonder if isn't just some openssl package that need to be installed as a required dependency before conda/python3.6
- Do you have working Wav2Lip ?
- chatgpt says opencv-python==4.1.0.25 does not support Python 3.6
This version was built for Python 3.7+.
Edit: But you had it working with Python 3.6, right ?
That's funny 'cause chatgpt told me python 3.6, 3.7 and 3.8 all support opencv-python==4.1.0.25
No, I haven't used it for years. From the issue you linked, I'd say back then I used Python 3.6. Today, if I had to reinstall it, I would avoid using the docker-nvidia image; I would use conda (not miniconda) directly with a Python 3.6 venv (now out of curiosity I'll try).
@vido89 so, I tried it with conda, without docker-nvidia
I gave up with py36 because the build of opencv-contrib-python was extremely slow (some bug in the wheel I guess)
py37 got it working, generated an mp4 from a wav and an mp4 using gpu
# install conda
conda create -n py37wav2lip python=3.7
conda activate py37wav2lip
# double upgrade might be unnecessary, just in case (for problem with py36 opencv-contrib-python wheel)
pip install --upgrade pip setuptools wheel
pip install --upgrade pip
sudo apt install ffmpeg
git clone https://github.com/Rudrabha/Wav2Lip.git
cd Wav2Lip
# conflict between opencv-python version and opencv-contrib-python version
# but apparently opencv-contrib-python isn't even used, try remove it from requirements.txt and skip next step
pip install -r requirements.txt
# found in some (opencv / opencv headless issue)
pip uninstall opencv-python-headless ; pip uninstall opencv-contrib-python ; pip uninstall opencv-python
pip install opencv-python==4.1.0.25
# for cuda support (found in some gpu not working issue)
pip install torch==1.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
pip install torchvision==0.11.3+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
# download checkpoints .pth from github Wav2Lip page into checkpoints/ directory
# don't know if this is needed
mkdir -p ~/.cache/torch/checkpoints
curl -SL -o ~/.cache/torch/checkpoints/s3fd-619a316812.pth "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth"
# run inference
python inference.py --checkpoint_path checkpoints/wav2lip.pth --face /tmp/input.mp4 --audio /tmp/sample_10.wav
@xenogenesi Awesome can you help me to write Dockerfile
ERROR: failed to solve: dockerfile parse error on line 2: unknown instruction: conda
@vido89 is there any reason you absolutely need it to work with docker?
Just install conda on your system, and run the commands shown, so much easier
@xenogenesi Aha OK, so I need to install Anaconda3-2024.10-1-Linux-x86_64.sh
right ?
@xenogenesi Aha OK, so I need to install
Anaconda3-2024.10-1-Linux-x86_64.sh
right ?
Yes it seems to me the right one, follow their instructions, it is easy, you can find many tutorials online on how to install and use conda
@xenogenesi Aha OK
# but apparently opencv-contrib-python isn't even used, try remove it from requirements.txt and skip next step
So should I run pip install -r requirements.txt
?
# but apparently opencv-contrib-python isn't even used, try remove it from requirements.txt and skip next step
So should I run
pip install -r requirements.txt
?
I would make a try, edit requirements.txt
and remove opencv-contrib-python
and then run pip install -r requirements.txt
, then skip my step that remove all opencv stuff and reinstall only the one package. But if that doesn't work keep the requirements as it were and follow all the steps.
Note: I just encoded one video and I had no problems, but I don't know if using different models or training Wav2Lip are gonna break because opencv-contrib-python is missing.
edit: I removed opencv-contrib-python because there was some version conflict with the opencv package, if you can pip install the requirements without errors.. even better.
@xenogenesi I installed cuda but I got this error
RuntimeError: Image too big to run face detection on GPU
how do I force it to run on CPU ?
@xenogenesi I installed cuda but I got this error
RuntimeError: Image too big to run face detection on GPU
how do I force it to run on CPU ?
Don't know, look in the Wav2Lip repository (the closed issues also), perhaps some env variable. I guess using the cpu will be very slow, and I think I saw somewhere on Wav2Lip repo that it is trained on small sizes.
It works, I cant believe this ! You are the men! Thank you @xenogenesi
Edit: is it due to ffmpeg to getting "pixelated" video ?
@vido89 Cool, I'm glad you made it work, sorry but I can't tell you why it's pixelated, I've only used it briefly
@xenogenesi OK Thank you once again !
@vido89 you need to remove the last
&& \
from the previous RUN, \ is a line continuationand you also should remove
python3-pip python3-dev python3-wheel python3-soundfile
installation trough apt-get, those are ubuntu packages which I doubt will work with the conda environmentfor those packages you need to find the corresponding replacement from the conda/python36 environment
you can use && to limit the number of filesystem layers that docker create, keep install requirements separate until it execute without failing so the other two will be cached