SzymonK1306 / deepfake-audio-detection

The main goal of the project is to find an ML algorithm for detecting audio recordings created by deepfake audio methods.
2 stars 0 forks source link

Tacotron2 #1

Open SzymonK1306 opened 6 months ago

SzymonK1306 commented 6 months ago

Instruction step by step how to install and train Tacotron2

tommikulevich commented 6 months ago

Tacotron2: Installation

General information


Instruction

Install conda if needed

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash [Miniconda3-latest-Linux-x86_64.sh](http://miniconda3-latest-linux-x86_64.sh/)

Create conda environment

conda create --name taco2 python=3.6.8 
conda activate taco2

Clone tacotron2

git clone https://github.com/NVIDIA/tacotron2.git
cd tacotron2/
git submodule init && git submodule update

Download example dataset LJ Speech and update filelists

# Make sure you are in tacotron2/ dir
wget https://data.keithito.com/data/speech/LJSpeech-1.1.tar.bz2
tar -xvjf LJSpeech-1.1.tar.bz2 
mv LJSpeech-1.1 ljs_dataset_folder
sed -i -- 's,DUMMY,ljs_dataset_folder/wavs,g' filelists/*.txt

Install modules required by tacotron2

pip install matplotlib tensorflow==1.15.2 numpy==1.19.4 inflect==0.2.5 librosa==0.6.0 scipy==1.5.4 Unidecode==1.0.22 pillow

Install torch and some other modules (fixes)

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
pip install numba==0.48.0 future resampy==0.3.1

Clone and configure apex

# Make sure you are in tacotron2/ dir
git clone https://github.com/NVIDIA/apex.git
cd apex/
pip install -r requirements.txt
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./

Start training (default hiperparameters)


cd ../    # Returning back to tacotron2/ dir
python train.py --output_directory=outdir --log_directory=logdir

[Optional] Run tensorboard in another terminal session

tensorboard --logdir=outdir/logdir
tommikulevich commented 3 months ago

Tacotron2: Docker Image

General information


Instruction

_Moved to branch add_tacotron2_docker_