标签:add mmu however rem describe tar getting ade diff
Machine learning essentially involves a ton of trial and error. You‘re letting a program try millions of different settings to land on an algorithm that sort of does what you want it to do. This process is really really slow unless you have the hardware required to speed this up.
The type of computations that the process does are well suited for graphics cards, rather than regular processors. It is pretty much required that you run the training process on a desktop or server capable GPU. Running this on your CPU means it can take weeks to train your model, compared to several hours on a GPU.
TL;DR: you need at least one of the following:
Alternatively there is a docker image that is based on Debian.
In its current iteration, the project relies heavily on the use of the command line, although a gui is available. if you are unfamiliar with command line tools, you may have difficulty setting up the environment and should perhaps not attempt any of the steps described in this guide. This guide assumes you have intermediate knowledge of the command line.
The developers are also not responsible for any damage you might cause to your own computer.
Python >= 3.2
virtualenv and virtualenvwrapper may help when you are not using docker.
If you are using an Nvidia graphics card You should install CUDA (https://developer.nvidia.com/cuda-zone) and CUDNN (https://developer.nvidia.com/cudnn). If you do not plan to build Tensorflow yourself, make sure you install no higher than version 9.0 of CUDA and 7.0.x of CUDNN
dlib is required for face recognition and is compiled as part of the setup process. You will need the following applications for your os to successfully install dlib (nb: list may be incomplete. Please raise an issue if another prerequisite is required for your OS):
Simply download the code from http://github.com/deepfakes/faceswap - For development it is recommended to use git instead of downloading the code and extracting it.
For now, extract the code to a directory where you‘re comfortable working with it. Navigate to it with the command line. For our example we will use ~/faceswap/
as our project directory.
Enter the folder that faceswap has been downloaded to and run:
python setup.py
If setup fails for any reason you can still manually install the packages listed within requirements.txt
CUDA with Docker in 20 minutes.
INFO The tool provides tips for installation
and installs required python packages
INFO Setup in Linux 4.14.39-1-MANJARO
INFO Installed Python: 3.6.5 64bit
INFO Installed PIP: 10.0.1
Enable Docker? [Y/n]
INFO Docker Enabled
Enable CUDA? [Y/n]
INFO CUDA Enabled
INFO 1. Install Docker
https://www.docker.com/community-edition
2. Install Nvidia-Docker & Restart Docker Service
https://github.com/NVIDIA/nvidia-docker
3. Build Docker Image For Faceswap
docker build -t deepfakes-gpu -f Dockerfile.gpu .
4. Mount faceswap volume and Run it
# without gui. tools.py gui not working.
nvidia-docker run --rm -it -p 8888:8888 --hostname faceswap-gpu --name faceswap-gpu -v /opt/faceswap:/srv deepfakes-gpu
# with gui. tools.py gui working.
## 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 -p 8888:8888 --hostname faceswap-gpu --name faceswap-gpu -v /opt/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
5. Open a new terminal to interact with the project
docker exec faceswap-gpu python /srv/tools.py gui
A successful setup log, without docker.
INFO The tool provides tips for installation
and installs required python packages
INFO Setup in Linux 4.14.39-1-MANJARO
INFO Installed Python: 3.6.5 64bit
INFO Installed PIP: 10.0.1
Enable Docker? [Y/n] n
INFO Docker Disabled
Enable CUDA? [Y/n]
INFO CUDA Enabled
INFO CUDA version: 9.1
INFO cuDNN version: 7
WARNING Tensorflow has no official prebuild for CUDA 9.1 currently.
To continue, You have to build your own tensorflow-gpu.
Help: https://www.tensorflow.org/install/install_sources
Are System Dependencies met? [y/N] y
INFO Installing Missing Python Packages...
INFO Installing tensorflow-gpu
INFO Installing pathlib==1.0.1
......
INFO Installing tqdm
INFO Installing matplotlib
INFO All python3 dependencies are met.
You are good to go.
Once all these requirements are installed, you can attempt to run the faceswap tools. Use the -h
or --help
options for a list of options.
python faceswap.py -h
or run with gui
to launch the GUI
python faceswap.py gui
Proceed to ../blob/master/USAGE.md
This guide is far from complete. Functionality may change over time, and new dependencies are added and removed as time goes on.
If you are experiencing issues, please raise them in the faceswap-playground repository instead of the main repo.
Setting up Faceswap can seem a little intimidating to new users, but it isn‘t that complicated, although a little time consuming. It is recommended to use Linux where possible as Windows will hog about 20% of your GPU Memory, making Faceswap run a little slower, however using Windows is perfectly fine and 100% supported.
Important Make sure to downoad the 2015 version of Microsoft Visual Studio
Download and install Microsoft Visual Studio 2015 from: https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409
On the install screen:
GPU Only If you do not have an Nvidia GPU you can skip this step.
At the time of writing Tensorflow (version 1.12) only supports Cuda up to version 9.0, but check https://www.tensorflow.org/install/gpu for the latest supported version. It is crucial that you download the correct version of Cuda.
Download and install the correct version of the Cuda Toolkit from: https://developer.nvidia.com/cuda-toolkit-archive
NB: Make a note of the install folder as you‘ll need to access it in the next step.
GPU Only If you do not have an Nvidia GPU you can skip this step.
As with Cuda you will need to install the correct version of cuDNN that the latest Tensorflow supports. At the time of writing this is Tensorflow v1.12 which supports cuDNN version 7.2, but check https://www.tensorflow.org/install/gpu for the latest supported version.
Download cuDNN from https://developer.nvidia.com/cudnn. You will need to create an account with Nvidia.
At the bottom of the list of latest cuDNN release will be a link to "Archived cuDNN Releases":
Select this and choose the latest version of cuDNN that supports the version of Cuda you installed and has a minor version greater than or equal to the latest version that Tensorflow supports. (Eg Tensorflow 1.12 supports Cuda 9.0 and cuDNN 7.2. There is not an archived version of cuDNN 7.2 for Cuda 9.0, so select cuDNN version 7.3)
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
):Install the latest stable release of CMake from https://cmake.org/download/. (Scroll down the page for Latest Releases and select the relevant Binary distribution installer for your OS).
When installing CMake make sure to enable the option to CMake to the system path:
Download and install the latest Python 3 Anacconda from: https://www.anaconda.com/download/. Unless you know what you are doing, you can leave all the options at default.
Download and install Git for Windows: https://git-scm.com/download/win. Unless you know what you are doing, you can leave all the options at default.
Reboot your PC, so that everything you have just installed gets registered.
To enter the virtual environment:
git clone https://github.com/deepfakes/faceswap.git
cd faceswap
python setup.py
and follow the prompts.If you have issues/errors follow the Manual install steps below.
If dlib failed to install you can follow the steps to manually install dlib.
Once dlib is installed follow these steps:
conda install tk
pip install -r requirements.txt
pip install tensorflow-gpu
pip install tensorflow
cd faceswap
python faceswap.py -h
or enter python faceswap.py gui
to launch the GUIA desktop shortcut can be added to easily launch staight into the faceswap GUI:
%USERPROFILE%\Anaconda3\envs\faceswap\python.exe %USERPROFILE%/faceswap/faceswap.py gui
It‘s good to keep faceswap up to date as new features are added and bugs are fixed. To do so:
cd faceswap
git pull --all
pip install --upgrade -r requirements.txt
You should only need to follow these steps if you want the latest Dlib code or the process was unable to install Dlib for you.
For reasons outside of our control, this is the trickiest part of the process, and most of the prerequisites you installed are to support just Dlib. It is recommended to build Dlib from source for 3 main reasons:
If you are not bothered about having GPU support or the latest version, scroll to the end of this section for a simple one-liner to install the CPU version of Dlib.
git clone https://github.com/davisking/dlib.git
cd dlib
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
python setup.py -G "Visual Studio 14 2015" install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA --clean
This will build and install dlib for you. It is worth backing up the generated .egg file somewhere so that you can re-install it if you ever need to rather than having to re-compile:
dlib-xx.yy.zz-py3.5-win-amd64.egg
to somewhere safepython -m easy_install <path to saved .egg>
Once Dlib is built, you can remove Visual Studio and CMake from your PC.
NB: Don‘t do this if you have already compiled Dlib with GPU support.
conda install -c conda-forge dlib
标签:add mmu however rem describe tar getting ade diff
原文地址:https://www.cnblogs.com/2008nmj/p/10335885.html