deepfakes / faceswap

Deepfakes Software For All
https://www.faceswap.dev
GNU General Public License v3.0
52.51k stars 13.23k forks source link

No such file or directory: 'git' while executing command git clone #825

Closed leu83 closed 5 years ago

leu83 commented 5 years ago

I'm trying to install faceswap in Ubuntu 18.04 I've managed to install Nvidia drivers, Cuda, Docker and Anaconda. Then, after creating a virtual environment, I clone the repo using git. Then I ran


(fakeswap) xx@xx:~/faceswap$ python3.7 setup.py
WARNING Running without root/admin privileges
INFO    The tool provides tips for installation
        and installs required python packages
INFO    Setup in Linux 4.15.0-55-generic
INFO    Installed Python: 3.7.3 64bit
INFO    Encoding: UTF-8
INFO    Upgrading pip...
INFO    Installed pip: 9.0.1
INFO    AMD Support: AMD GPU support is currently limited.
        Nvidia Users MUST answer 'no' to this option.
Enable AMD Support? [y/N] N
INFO    AMD Support Disabled
Enable  Docker? [y/N] y
INFO    Docker Enabled
Enable  CUDA? [Y/n] Y
INFO    CUDA Enabled
INFO    1. Install Docker
        https://www.docker.com/community-edition

        2. Install latest CUDA
        CUDA: https://developer.nvidia.com/cuda-downloads

        3. Install Nvidia-Docker & Restart Docker Service
        https://github.com/NVIDIA/nvidia-docker

        4. Build Docker Image For Faceswap
        docker build -t deepfakes-gpu -f Dockerfile.gpu .

        5. Mount faceswap volume and Run it
        # without gui 
        docker run -tid -p 8888:8888 \ 
            --hostname deepfakes-gpu --name deepfakes-gpu \ 
            -v /home/ubu7/faceswap:/srv \ 
            deepfakes-gpu

        # with gui.
        ## enable local access to X11 server
        xhost +local:
        ## enable nvidia device if working under bumblebee
        echo ON > /proc/acpi/bbswitch
        ## create container
        nvidia-docker run -tid -p 8888:8888 \ 
            --hostname deepfakes-gpu --name deepfakes-gpu \ 
            -v /home/ubu7/faceswap:/srv \ 
            -v /tmp/.X11-unix:/tmp/.X11-unix \ 
            -e DISPLAY=unix$DISPLAY \ 
            -e AUDIO_GID=`getent group audio | cut -d: -f3` \ 
            -e VIDEO_GID=`getent group video | cut -d: -f3` \ 
            -e GID=`id -g` \ 
            -e UID=`id -u` \ 
            deepfakes-gpu

        6. Open a new terminal to interact with the project
        docker exec deepfakes-gpu python /srv/faceswap.py gui

After this, I try to run this: sudo docker build -t deepfakes-gpu -f Dockerfile.gpu . But I get this:

Sending build context to Docker daemon   5.12kB
Step 1/11 : FROM tensorflow/tensorflow:1.12.0-gpu-py3
 ---> 413b9533f92a
Step 2/11 : RUN add-apt-repository -y ppa:jonathonf/ffmpeg-4  && apt-get update -qq -y  && apt-get install -y libsm6 libxrender1 libxext-dev python3-tk ffmpeg  && apt-get clean  && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 84e4a27a0670
Step 3/11 : COPY requirements.txt /opt/
 ---> Using cache
 ---> 9de78b69508a
Step 4/11 : RUN pip3 install --upgrade pip
 ---> Using cache
 ---> e4b5f069ab49
Step 5/11 : RUN pip3 --no-cache-dir install -r /opt/requirements.txt && rm /opt/requirements.txt
 ---> Running in 4fde99d87b73
Ignoring pywin32: markers 'sys_platform == "win32"' don't match your environment
Collecting git+https://github.com/deepfakes/nvidia-ml-py3.git (from -r /opt/requirements.txt (line 16))
  Cloning https://github.com/deepfakes/nvidia-ml-py3.git to /tmp/pip-req-build-zl1orwf2
  Running command git clone -q https://github.com/deepfakes/nvidia-ml-py3.git /tmp/pip-req-build-zl1orwf2
  ERROR: Error [Errno 2] No such file or directory: 'git' while executing command git clone -q https://github.com/deepfakes/nvidia-ml-py3.git /tmp/pip-req-build-zl1orwf2
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
The command '/bin/sh -c pip3 --no-cache-dir install -r /opt/requirements.txt && rm /opt/requirements.txt' returned a non-zero code: 1

Isn't git installed inside virtual environment?

torzdf commented 5 years ago

Don't use the Docker. Re-run setup.py but say n to docker

leu83 commented 5 years ago

Thanks. Now it seems as if cudNN is not installed, even though I did this:

$ CUDNN_FILE="cudnn-9.0-linux-x64-v7.2.1.38"
$ wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.2.1/
      prod/9.0_20180806/${CUDNN_FILE}
$ tar -xzvf ${CUDNN_FILE}

Then this:

$ sudo cp -P cuda/include/cudnn.h /usr/local/cuda-9.0/include
$ sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-9.0/lib64/
$ sudo chmod a+r /usr/local/cuda-9.0/lib64/libcudnn*

Now I'm getting this:

INFO    The tool provides tips for installation
        and installs required python packages
INFO    Setup in Linux 4.15.0-55-generic
INFO    Installed Python: 3.7.3 64bit
INFO    Encoding: UTF-8
INFO    Upgrading pip...
INFO    Installed pip: 19.2.1
INFO    AMD Support: AMD GPU support is currently limited.
        Nvidia Users MUST answer 'no' to this option.
Enable AMD Support? [y/N] n
INFO    AMD Support Disabled
Enable  Docker? [y/N] n
INFO    Docker Disabled
Enable  CUDA? [Y/n] y
INFO    CUDA Enabled
INFO    CUDA version: 9.0
ERROR   cuDNN not found. See https://github.com/deepfakes/faceswap/blob/master/INSTALL.md#cudnn for instructions
WARNING The minimum Tensorflow requirement is 1.12. 
        Tensorflow currently has no official prebuild for your CUDA, cuDNN combination.
        Either install a combination that Tensorflow supports or build and install your own tensorflow-gpu.
        CUDA Version: 9.0
        cuDNN Version: 
        Help:
        Building Tensorflow: https://www.tensorflow.org/install/install_sources
        Tensorflow supported versions: https://www.tensorflow.org/install/source#tested_build_configurations
Location of custom tensorflow-gpu wheel (leave blank to manually install): 

How can I tell if cudNN is correctly installed?

torzdf commented 5 years ago

If you setup in a Conda environment, you can completely remove system Cuda/cuDNN and just let setup.py install Cuda for you.

leu83 commented 5 years ago

I think I have tried both running setup.py in (base) and (condaEnv) but still getting cudNN Version: (empty)

It might be possible that tensorflow is not correctly installed though...