/deepfacelab-docker

Docker Containers for DeepFaceLab with TensorFlow in Anaconda 3

Primary LanguageDockerfileGNU General Public License v3.0GPL-3.0

DeepFaceLab/TensorFlow GPU-enabled Docker Container

Provides an NVIDIA GPU-enabled container with DeepFaceLab pre-installed on an Anaconda and TensorFlow container xychelsea/tensorflow:latest-gpu.

DeepFaceLab with TensorFlow

DeepFaceLab is an open source research project, based on TensorFlow exploring the role of machine learning as a tool in the creative process. TensorFlow is an open source platform for machine learning. It provides tools, libraries and community resources for researcher and developers to build and deploy machine learning applications. Anaconda is an open data science platform based on Python 3. This container installs TensorFlow through the conda command with a lightweight version of Anaconda (Miniconda) and the conda-forge repository in the /usr/local/anaconda directory. The default user, anaconda runs a Tini shell /usr/bin/tini, and comes preloaded with the conda command in the environment $PATH. Additional versions with NVIDIA/CUDA support and Jupyter Notebooks tags are available.

NVIDIA/CUDA GPU-enabled Containers

Two flavors provide an NVIDIA GPU-enabled container with TensorFlow pre-installed through Anaconda.

Getting the containers

Vanilla DeepFaceLab

The base container, based on the xychelsea/tensorflow:latest from the Anaconda 3 container stack (xychelsea/anaconda3:latest) running Tini shell. For the container with a /usr/bin/tini entry point, use:

docker pull xychelsea/deepfacelab:latest

With Jupyter Notebooks server pre-installed, pull with:

docker pull xychelsea/deepfacelab:latest-jupyter

DeepFaceLab with NVIDIA/CUDA GPU support

Modified versions of nvidia/cuda:latest container, with support for NVIDIA/CUDA graphical processing units through the Tini shell. For the container with a /usr/bin/tini entry point:

docker pull xychelsea/deepfacelab:latest-gpu

With Jupyter Notebooks server pre-installed, pull with:

docker pull xychelsea/deepfacelab:latest-gpu-jupyter

Running the containers

To run the containers with the generic Docker application or NVIDIA enabled Docker, use the docker run command with a bound volume directory workspace attached at mount point /usr/local/deepfacelab/workspace.

Vanilla DeepFaceLab

docker run --rm -it \
    -v workspace:/usr/local/deepfacelab/workspace \
    xychelsea/deepfacelab:latest

With Jupyter Notebooks server pre-installed, run with:

docker run --rm -it -d
     -v workspace:/usr/local/deepfacelab/workspace \
     -p 8888:8888 \
     xychelsea/deepfacelab:latest-jupyter

DeepFaceLab with NVIDIA/CUDA GPU support

docker run --gpus all --rm -it
     -v workspace:/usr/local/deepface/workspace \
     xychelsea/deepfacelab:latest-gpu /bin/bash

With Jupyter Notebooks server pre-installed, run with:

docker run --gpus all --rm -it -d
     -v workspace:/usr/local/deepfacelab/workspace \
     -p 8888:8888 \
     xychelsea/deepfacelab:latest-gpu-jupyter

Using DeepFaceLab

[TK]

Building the containers

To build either a GPU-enabled container or without GPUs, use the deepfacelab-docker GitHub repository.

git clone git://github.com/iperov/DeepFaceLab.git

Vanilla DeepFaceLab

The base container, based on the xychelsea/deepfacelab:latest from the Anaconda 3 container stack (xychelsea/anaconda3:latest) running Tini shell:

docker build -t deepfacelab:latest -f Dockerfile .

With Jupyter Notebooks server pre-installed, build with:

docker build -t deepfacelab:latest-jupyter -f Dockerfile.jupyter .

DeepFaceLab with NVIDIA/CUDA GPU support

docker build -t deepfacelab:latest-gpu -f Dockerfile.nvidia .

With Jupyter Notebooks server pre-installed, build with:

docker build -t deepfacelab:latest-gpu-jupyter -f Dockerfile.nvidia-jupyter .

Environment

The default environment uses the following configurable options:

ANACONDA_GID=100
ANACONDA_PATH=/usr/local/anaconda3
ANACONDA_UID=1000
ANACONDA_USER=anaconda
ANACONDA_ENV=magenta
DEEPFACELAB_PATH=/usr/local/deepfacelab
DEEPFACELAB_HOME=$HOME/deepfacelab
DEEPFACELAB_WORKSPACE=$DEEPFACELAB_PATH/workspace
DEEPFACELAB_SCRIPTS=$DEEPFACELAB_PATH/scripts

References