Latest release faceswap with Vast.ai server setup - training

Training your model
Forum rules
Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.
Post Reply
User avatar
police.bike
Posts: 19
Joined: Tue Jun 30, 2020 3:37 pm
Has thanked: 7 times
Been thanked: 3 times

Latest release faceswap with Vast.ai server setup - training

Post by police.bike »

If you wonder how to train using vast.ai or any cloud servers with latest faceswap or if you run across issues with r1.0 edition on cloud servers, then you are like me.

After much of research and reading, below is what got me a successful cloud training server. The configuration is for Ubuntu servers with >15Gb disk space and at least 1 NVIDIA GPU.

Step 1 : Once you ssh into the server, do an update

Code: Select all

apt-get update

Step 2: Install wget and other utils. this will help you with anaconda installation

Code: Select all

apt-get install -y wget git nano p7zip-full

Step 3 -

Code: Select all

wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh

You can get the latest release anaconda for linux from the anaconda website. Just put the download link to the .sh file in above after wget. https://www.anaconda.com/products/individual#linux

Ste 4 - install anaconda using the step 3 downloaded sh file. Enter yes and check installation path if you would like to change.

Code: Select all

bash <fileName>.sh

Step 5 - Initialize conda virtual environment management using

Code: Select all

source ~/.bashrc

Step 6 - Create your faceswap environment. Use any name of your choice
python version is important for the latest release. I recommend 3.7

Code: Select all

conda create --name faceswap python==3.7

Activate faceswap

Code: Select all

conda activate fswp

Step 7 - install 2.2.0 version of tensorflow gpu. this is most important

Code: Select all

conda install tensorflow-gpu==2.2.0

Stepp 8 - install other libraries. Might need for ui and few code components. better to install

Code: Select all

apt-get install -y libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6

Step 9 - Clone faceswap from repo

Code: Select all

git clone --depth 1 https://github.com/deepfakes/faceswap.git

And then finally,

Code: Select all

python faceswap.py

You are good to go once you set the training and other options on config.

PS:

If you land up in error with a clod server coming up with a pre-existing tensorflow, then ensure version is 2.2.0.
Else uninstall the existing and install 2.2.0 and repeat from step 6

pip uninstall tensorflow-gpu
pip uninstall keras
pip install tensorflow-gpu==2.2.0
pip install keras


Post Reply