diff --git a/docker_trainer/Dockerfile b/docker_trainer/Dockerfile new file mode 100644 index 00000000..003afd68 --- /dev/null +++ b/docker_trainer/Dockerfile @@ -0,0 +1,39 @@ +FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as base + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get -y update && apt-get install -y emacs git curl python3-pip libsndfile1-dev ffmpeg + +RUN git clone --depth 1 -b v1.5.0.0_SiFiGAN https://github.com/isletennos/MMVC_Trainer.git + +ADD /model/D_v15_best.pth /MMVC_Trainer/fine_model/ +ADD /model/G_v15_best.pth /MMVC_Trainer/fine_model/ + +RUN pip install pydub==0.25.1 +RUN pip install tqdm==4.64.1 +RUN pip install librosa==0.9.2 +RUN pip install torch==1.13.1 +RUN pip install torchaudio==0.13.1 +RUN pip install psutil==5.9.4 +RUN pip install tensorboard==2.11.2 +RUN pip install pytz==2022.7.1 +RUN pip install pyworld==0.3.2 +RUN pip install retry==0.9.2 +RUN pip install h5py==3.8.0 +RUN pip install matplotlib==3.6.3 + +ADD /warmup.py / +RUN python3 warmup.py +WORKDIR /MMVC_Trainer/ + +# python3 normalize.py True +# python3 create_dataset.py -f train_config -s 24000 -m dataset/multi_speaker_correspondence.txt +# tensorboard --logdir logs --port 5000 +# python3 train_ms.py -c configs/train_config.json -m 20220306_24000 -fg fine_model/G_v15_best.pth -fd fine_model/D_v15_best.pth + +#$ docker run --gpus all --rm -ti -v `pwd`/trainer/dataset:/MMVC_Trainer/dataset -v `pwd`/trainer/configs:/MMVC_Trainer/configs -v `pwd`/trainer/F0:/MMVC_Trainer/F0 -v `pwd`/trainer/cF0:/MMVC_Trainer/cF0 -v `pwd`/trainer/units:/MMVC_Trainer/units -v `pwd`/trainer/logs:/MMVC_Trainer/logs -v `pwd`/trainer/filelists:/MMVC_Trainer/filelists -p 5000:5000 trainer /bin/bash + + + + + diff --git a/docker_trainer/README.md b/docker_trainer/README.md new file mode 100644 index 00000000..a3ec2269 --- /dev/null +++ b/docker_trainer/README.md @@ -0,0 +1,55 @@ +MMVC Server +---- +# 起動方法 + +(1) Datasetを`trainer/dataset`におく +```sh +trainer/dataset/ +├── 00_myvoice +│   ├── text +│   │   ├── emotion001.txt +│   │   ├── emotion002.txt +... +│   │   └── emotion100.txt +│   └── wav +│   ├── emotion001.wav +│   ├── emotion002.wav +... +│   └── emotion100.wav +├── 1205_zundamon +│   ├── text +│   │   ├── emoNormal_001.txt +│   │   ├── emoNormal_002.txt +... +│   │   └── emoNormal_100.txt +│   └── wav +│   ├── emoNormal_001.wav +│   ├── emoNormal_002.wav +... +│   └── emoNormal_100.wav +├── 344_tsumugi +│   ├── text +│   │   ├── VOICEACTRESS100_001.txt +│   │   ├── VOICEACTRESS100_002.txt +... +│   │   └── emoNormal_100.txt +│   └── wav +│   ├── VOICEACTRESS100_001.wav +│   ├── VOICEACTRESS100_002.wav +... +│   └── emoNormal_100.wav +└── multi_speaker_correspondence.txt +``` + +(2) start.shをrootにコピー + +(3) `bash start.sh`を実行 + +(4) Docker内で次のコマンドを実行 +batch sizeは適宜調整 +```sh +$ python3 normalize.py True +$ python3 create_dataset.py -f train_config -s 24000 -m dataset/multi_speaker_correspondence.txt +$ tensorboard --logdir logs --port 5000 +$ python3 train_ms.py -c configs/train_config.json -m 20220306_24000 -fg fine_model/G_v15_best.pth -fd fine_model/D_v15_best.pth +``` diff --git a/docker_trainer/model/.gitignore b/docker_trainer/model/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/docker_trainer/model/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/docker_trainer/start.sh b/docker_trainer/start.sh new file mode 100644 index 00000000..af33d4e8 --- /dev/null +++ b/docker_trainer/start.sh @@ -0,0 +1,14 @@ +docker run --gpus all --rm -ti \ + -v `pwd`/trainer/dataset:/MMVC_Trainer/dataset \ + -v `pwd`/trainer/configs:/MMVC_Trainer/configs \ + -v `pwd`/trainer/F0:/MMVC_Trainer/F0 \ + -v `pwd`/trainer/cF0:/MMVC_Trainer/cF0 \ + -v `pwd`/trainer/units:/MMVC_Trainer/units \ + -v `pwd`/trainer/logs:/MMVC_Trainer/logs \ + -v `pwd`/trainer/filelists:/MMVC_Trainer/filelists \ + -p 5000:5000 \ + trainer /bin/bash + + + + diff --git a/docker_trainer/warmup.py b/docker_trainer/warmup.py new file mode 100644 index 00000000..c5ae8f8a --- /dev/null +++ b/docker_trainer/warmup.py @@ -0,0 +1,3 @@ +import torch + +hubert = torch.hub.load("bshall/hubert:main", "hubert_soft") diff --git a/package.json b/package.json index c6f6d544..ff528e71 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "build:docker": "date +%Y%m%d%H%M%S > docker/dummy && DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile docker/ -t voice-changer", "build:docker:onnx": "DOCKER_BUILDKIT=1 docker build -f docker_onnx/Dockerfile docker/ -t onnx-converter", + "build:docker:trainer": "DOCKER_BUILDKIT=1 docker build -f docker_trainer/Dockerfile docker_trainer/ -t trainer", "copy:frontend": "docker run -v `pwd`/frontend/dist:/frontend/dist --entrypoint /bin/bash -ti voice-changer -c \"cp -r /voice-changer-internal/frontend/dist/* /frontend/dist\"", "copy:backend": "docker run -v `pwd`/demo:/demo --entrypoint /bin/bash -ti voice-changer -c \"cp -r /voice-changer-internal/voice-change-service/* /demo/ && rm -rf /demo/MMVC_Trainer/.git && rm -rf /demo/MMVC_Trainer/.gitignore \"", "create:demo": "run-p copy:frontend copy:backend", diff --git a/trainer/F0/.gitignore b/trainer/F0/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/trainer/F0/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/trainer/cF0/.gitignore b/trainer/cF0/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/trainer/cF0/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/trainer/configs/.gitignore b/trainer/configs/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/trainer/configs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/trainer/dataset/.gitignore b/trainer/dataset/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/trainer/dataset/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/trainer/logs/.gitignore b/trainer/logs/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/trainer/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/trainer/units/.gitignore b/trainer/units/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/trainer/units/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore