{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "65CU-n-JHhbY" }, "source": [ "# Clone repository" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "i_0vZ-OjHVNu", "outputId": "3f4a500c-8728-4d9b-e014-615339461f3d" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Cloning into 'vits-mandarin-biaobei'...\n", "remote: Enumerating objects: 75, done.\u001b[K\n", "remote: Counting objects: 100% (75/75), done.\u001b[K\n", "remote: Compressing objects: 100% (73/73), done.\u001b[K\n", "remote: Total 75 (delta 24), reused 30 (delta 2), pack-reused 0\u001b[K\n", "Unpacking objects: 100% (75/75), done.\n", "/content/vits-mandarin-biaobei\n" ] } ], "source": [ "!git clone https://github.com/AlexandaJerry/vits-mandarin-biaobei\n", "%cd vits-mandarin-biaobei" ] }, { "cell_type": "code", "source": [ "!/opt/bin/nvidia-smi" ], "metadata": { "id": "smGF80ufrZxu", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "a1dccd34-a9c1-4265-893d-005b87c619a0" }, "execution_count": 2, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Fri Aug 12 08:55:19 2022 \n", "+-----------------------------------------------------------------------------+\n", "| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n", "|-------------------------------+----------------------+----------------------+\n", "| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n", "| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n", "| | | MIG M. |\n", "|===============================+======================+======================|\n", "| 0 Tesla P100-PCIE... Off | 00000000:00:04.0 Off | 0 |\n", "| N/A 37C P0 25W / 250W | 0MiB / 16280MiB | 0% Default |\n", "| | | N/A |\n", "+-------------------------------+----------------------+----------------------+\n", " \n", "+-----------------------------------------------------------------------------+\n", "| Processes: |\n", "| GPU GI CI PID Type Process name GPU Memory |\n", "| ID ID Usage |\n", "|=============================================================================|\n", "| No running processes found |\n", "+-----------------------------------------------------------------------------+\n" ] } ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "6vOAlBTavYsc", "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "outputId": "13ed039d-51a5-4dea-f54d-9230e2a46e66" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", "Collecting Cython==0.29.21\n", " Downloading Cython-0.29.21-cp37-cp37m-manylinux1_x86_64.whl (2.0 MB)\n", "\u001b[K |████████████████████████████████| 2.0 MB 5.0 MB/s \n", "\u001b[?25hCollecting librosa==0.8.0\n", " Downloading librosa-0.8.0.tar.gz (183 kB)\n", "\u001b[K |████████████████████████████████| 183 kB 54.8 MB/s \n", "\u001b[?25hCollecting matplotlib==3.3.1\n", " Downloading matplotlib-3.3.1-cp37-cp37m-manylinux1_x86_64.whl (11.6 MB)\n", "\u001b[K |████████████████████████████████| 11.6 MB 30.7 MB/s \n", "\u001b[?25hRequirement already satisfied: numpy==1.21.6 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 4)) (1.21.6)\n", "Collecting phonemizer==2.2.1\n", " Downloading phonemizer-2.2.1-py3-none-any.whl (49 kB)\n", "\u001b[K |████████████████████████████████| 49 kB 5.4 MB/s \n", "\u001b[?25hCollecting scipy==1.5.2\n", " Downloading scipy-1.5.2-cp37-cp37m-manylinux1_x86_64.whl (25.9 MB)\n", "\u001b[K |████████████████████████████████| 25.9 MB 1.3 MB/s \n", "\u001b[?25hCollecting Unidecode==1.1.1\n", " Downloading Unidecode-1.1.1-py2.py3-none-any.whl (238 kB)\n", "\u001b[K |████████████████████████████████| 238 kB 61.5 MB/s \n", "\u001b[?25hCollecting pypinyin==0.47.0\n", " Downloading pypinyin-0.47.0-py2.py3-none-any.whl (1.4 MB)\n", "\u001b[K |████████████████████████████████| 1.4 MB 65.4 MB/s \n", "\u001b[?25hRequirement already satisfied: audioread>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (2.1.9)\n", "Requirement already satisfied: scikit-learn!=0.19.0,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (1.0.2)\n", "Requirement already satisfied: joblib>=0.14 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (1.1.0)\n", "Requirement already satisfied: decorator>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (4.4.2)\n", "Requirement already satisfied: resampy>=0.2.2 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (0.3.1)\n", "Requirement already satisfied: numba>=0.43.0 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (0.56.0)\n", "Requirement already satisfied: soundfile>=0.9.0 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (0.10.3.post1)\n", "Requirement already satisfied: pooch>=1.0 in /usr/local/lib/python3.7/dist-packages (from librosa==0.8.0->-r requirements.txt (line 2)) (1.6.0)\n", "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.3.1->-r requirements.txt (line 3)) (0.11.0)\n", "Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.3.1->-r requirements.txt (line 3)) (2.8.2)\n", "Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.3.1->-r requirements.txt (line 3)) (7.1.2)\n", "Requirement already satisfied: certifi>=2020.06.20 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.3.1->-r requirements.txt (line 3)) (2022.6.15)\n", "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.3.1->-r requirements.txt (line 3)) (3.0.9)\n", "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.3.1->-r requirements.txt (line 3)) (1.4.4)\n", "Collecting segments\n", " Downloading segments-2.2.1-py2.py3-none-any.whl (15 kB)\n", "Requirement already satisfied: attrs>=18.1 in /usr/local/lib/python3.7/dist-packages (from phonemizer==2.2.1->-r requirements.txt (line 5)) (22.1.0)\n", "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1->matplotlib==3.3.1->-r requirements.txt (line 3)) (4.1.1)\n", "Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from numba>=0.43.0->librosa==0.8.0->-r requirements.txt (line 2)) (57.4.0)\n", "Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from numba>=0.43.0->librosa==0.8.0->-r requirements.txt (line 2)) (4.12.0)\n", "Requirement already satisfied: llvmlite<0.40,>=0.39.0dev0 in /usr/local/lib/python3.7/dist-packages (from numba>=0.43.0->librosa==0.8.0->-r requirements.txt (line 2)) (0.39.0)\n", "Requirement already satisfied: appdirs>=1.3.0 in /usr/local/lib/python3.7/dist-packages (from pooch>=1.0->librosa==0.8.0->-r requirements.txt (line 2)) (1.4.4)\n", "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from pooch>=1.0->librosa==0.8.0->-r requirements.txt (line 2)) (21.3)\n", "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.7/dist-packages (from pooch>=1.0->librosa==0.8.0->-r requirements.txt (line 2)) (2.23.0)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.1->matplotlib==3.3.1->-r requirements.txt (line 3)) (1.15.0)\n", "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->pooch>=1.0->librosa==0.8.0->-r requirements.txt (line 2)) (3.0.4)\n", "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->pooch>=1.0->librosa==0.8.0->-r requirements.txt (line 2)) (2.10)\n", "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->pooch>=1.0->librosa==0.8.0->-r requirements.txt (line 2)) (1.24.3)\n", "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn!=0.19.0,>=0.14.0->librosa==0.8.0->-r requirements.txt (line 2)) (3.1.0)\n", "Requirement already satisfied: cffi>=1.0 in /usr/local/lib/python3.7/dist-packages (from soundfile>=0.9.0->librosa==0.8.0->-r requirements.txt (line 2)) (1.15.1)\n", "Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi>=1.0->soundfile>=0.9.0->librosa==0.8.0->-r requirements.txt (line 2)) (2.21)\n", "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->numba>=0.43.0->librosa==0.8.0->-r requirements.txt (line 2)) (3.8.1)\n", "Collecting csvw>=1.5.6\n", " Downloading csvw-3.1.1-py2.py3-none-any.whl (56 kB)\n", "\u001b[K |████████████████████████████████| 56 kB 4.3 MB/s \n", "\u001b[?25hRequirement already satisfied: regex in /usr/local/lib/python3.7/dist-packages (from segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (2022.6.2)\n", "Collecting clldutils>=1.7.3\n", " Downloading clldutils-3.12.0-py2.py3-none-any.whl (197 kB)\n", "\u001b[K |████████████████████████████████| 197 kB 55.8 MB/s \n", "\u001b[?25hRequirement already satisfied: tabulate>=0.7.7 in /usr/local/lib/python3.7/dist-packages (from clldutils>=1.7.3->segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (0.8.10)\n", "Collecting colorlog\n", " Downloading colorlog-6.6.0-py2.py3-none-any.whl (11 kB)\n", "Collecting isodate\n", " Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)\n", "\u001b[K |████████████████████████████████| 41 kB 599 kB/s \n", "\u001b[?25hCollecting rdflib\n", " Downloading rdflib-6.2.0-py3-none-any.whl (500 kB)\n", "\u001b[K |████████████████████████████████| 500 kB 54.6 MB/s \n", "\u001b[?25hRequirement already satisfied: babel in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (2.10.3)\n", "Requirement already satisfied: jsonschema in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (4.3.3)\n", "Collecting colorama\n", " Downloading colorama-0.4.5-py2.py3-none-any.whl (16 kB)\n", "Collecting language-tags\n", " Downloading language_tags-1.1.0-py2.py3-none-any.whl (210 kB)\n", "\u001b[K |████████████████████████████████| 210 kB 60.4 MB/s \n", "\u001b[?25hCollecting rfc3986<2\n", " Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)\n", "Requirement already satisfied: uritemplate>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (3.0.1)\n", "Requirement already satisfied: pytz>=2015.7 in /usr/local/lib/python3.7/dist-packages (from babel->csvw>=1.5.6->segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (2022.1)\n", "Requirement already satisfied: importlib-resources>=1.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (5.9.0)\n", "Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer==2.2.1->-r requirements.txt (line 5)) (0.18.1)\n", "Building wheels for collected packages: librosa\n", " Building wheel for librosa (setup.py) ... \u001b[?25l\u001b[?25hdone\n", " Created wheel for librosa: filename=librosa-0.8.0-py3-none-any.whl size=201396 sha256=a6a20a8eb919c964b683a14e24e8db9bb8964e3f5662c97cc415e19e09c19045\n", " Stored in directory: /root/.cache/pip/wheels/de/1e/aa/d91797ae7e1ce11853ee100bee9d1781ae9d750e7458c95afb\n", "Successfully built librosa\n", "Installing collected packages: isodate, rfc3986, rdflib, language-tags, colorama, csvw, colorlog, scipy, clldutils, segments, Unidecode, pypinyin, phonemizer, matplotlib, librosa, Cython\n", " Attempting uninstall: scipy\n", " Found existing installation: scipy 1.7.3\n", " Uninstalling scipy-1.7.3:\n", " Successfully uninstalled scipy-1.7.3\n", " Attempting uninstall: matplotlib\n", " Found existing installation: matplotlib 3.2.2\n", " Uninstalling matplotlib-3.2.2:\n", " Successfully uninstalled matplotlib-3.2.2\n", " Attempting uninstall: librosa\n", " Found existing installation: librosa 0.8.1\n", " Uninstalling librosa-0.8.1:\n", " Successfully uninstalled librosa-0.8.1\n", " Attempting uninstall: Cython\n", " Found existing installation: Cython 0.29.32\n", " Uninstalling Cython-0.29.32:\n", " Successfully uninstalled Cython-0.29.32\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "pymc3 3.11.5 requires scipy<1.8.0,>=1.7.3, but you have scipy 1.5.2 which is incompatible.\u001b[0m\n", "Successfully installed Cython-0.29.21 Unidecode-1.1.1 clldutils-3.12.0 colorama-0.4.5 colorlog-6.6.0 csvw-3.1.1 isodate-0.6.1 language-tags-1.1.0 librosa-0.8.0 matplotlib-3.3.1 phonemizer-2.2.1 pypinyin-0.47.0 rdflib-6.2.0 rfc3986-1.5.0 scipy-1.5.2 segments-2.2.1\n" ] }, { "output_type": "display_data", "data": { "application/vnd.colab-display-data+json": { "pip_warning": { "packages": [ "matplotlib", "mpl_toolkits" ] } } }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "Reading package lists... Done\n", "Building dependency tree \n", "Reading state information... Done\n", "The following package was automatically installed and is no longer required:\n", " libnvidia-common-460\n", "Use 'sudo apt autoremove' to remove it.\n", "The following additional packages will be installed:\n", " espeak-data libespeak1 libportaudio2 libsonic0\n", "The following NEW packages will be installed:\n", " espeak espeak-data libespeak1 libportaudio2 libsonic0\n", "0 upgraded, 5 newly installed, 0 to remove and 19 not upgraded.\n", "Need to get 1,219 kB of archives.\n", "After this operation, 3,031 kB of additional disk space will be used.\n", "Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libportaudio2 amd64 19.6.0-1 [64.6 kB]\n", "Get:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libsonic0 amd64 0.2.0-6 [13.4 kB]\n", "Get:3 http://archive.ubuntu.com/ubuntu bionic/universe amd64 espeak-data amd64 1.48.04+dfsg-5 [934 kB]\n", "Get:4 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libespeak1 amd64 1.48.04+dfsg-5 [145 kB]\n", "Get:5 http://archive.ubuntu.com/ubuntu bionic/universe amd64 espeak amd64 1.48.04+dfsg-5 [61.6 kB]\n", "Fetched 1,219 kB in 1s (1,365 kB/s)\n", "debconf: unable to initialize frontend: Dialog\n", "debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 5.)\n", "debconf: falling back to frontend: Readline\n", "debconf: unable to initialize frontend: Readline\n", "debconf: (This frontend requires a controlling tty.)\n", "debconf: falling back to frontend: Teletype\n", "dpkg-preconfigure: unable to re-open stdin: \n", "Selecting previously unselected package libportaudio2:amd64.\n", "(Reading database ... 155680 files and directories currently installed.)\n", "Preparing to unpack .../libportaudio2_19.6.0-1_amd64.deb ...\n", "Unpacking libportaudio2:amd64 (19.6.0-1) ...\n", "Selecting previously unselected package libsonic0:amd64.\n", "Preparing to unpack .../libsonic0_0.2.0-6_amd64.deb ...\n", "Unpacking libsonic0:amd64 (0.2.0-6) ...\n", "Selecting previously unselected package espeak-data:amd64.\n", "Preparing to unpack .../espeak-data_1.48.04+dfsg-5_amd64.deb ...\n", "Unpacking espeak-data:amd64 (1.48.04+dfsg-5) ...\n", "Selecting previously unselected package libespeak1:amd64.\n", "Preparing to unpack .../libespeak1_1.48.04+dfsg-5_amd64.deb ...\n", "Unpacking libespeak1:amd64 (1.48.04+dfsg-5) ...\n", "Selecting previously unselected package espeak.\n", "Preparing to unpack .../espeak_1.48.04+dfsg-5_amd64.deb ...\n", "Unpacking espeak (1.48.04+dfsg-5) ...\n", "Setting up libportaudio2:amd64 (19.6.0-1) ...\n", "Setting up espeak-data:amd64 (1.48.04+dfsg-5) ...\n", "Setting up libsonic0:amd64 (0.2.0-6) ...\n", "Setting up libespeak1:amd64 (1.48.04+dfsg-5) ...\n", "Setting up espeak (1.48.04+dfsg-5) ...\n", "Processing triggers for man-db (2.8.3-2ubuntu0.1) ...\n", "Processing triggers for libc-bin (2.27-3ubuntu1.5) ...\n" ] } ], "source": [ "!pip install -r requirements.txt\n", "!sudo apt-get install espeak -y" ] }, { "cell_type": "markdown", "metadata": { "id": "G0iLn2JxKYhl" }, "source": [ "# Mount Google Drive" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ZOgjdsQgKTfD", "outputId": "b02c6486-634d-4e3a-e5ef-b864a6680ad0" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n" ] } ], "source": [ "from google.colab import drive\n", "drive.mount('/content/drive')" ] }, { "cell_type": "markdown", "metadata": { "id": "UZ9maSoUmHaS" }, "source": [ "# Unpack dataset" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "id": "N3a-FsHghwXS", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "60bc1795-1aef-4a8d-9b5c-172e09f65bda" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", "Collecting pyunpack\n", " Downloading pyunpack-0.3-py2.py3-none-any.whl (4.1 kB)\n", "Collecting easyprocess\n", " Downloading EasyProcess-1.1-py3-none-any.whl (8.7 kB)\n", "Collecting entrypoint2\n", " Downloading entrypoint2-1.1-py2.py3-none-any.whl (9.9 kB)\n", "Installing collected packages: entrypoint2, easyprocess, pyunpack\n", "Successfully installed easyprocess-1.1 entrypoint2-1.1 pyunpack-0.3\n", "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", "Collecting patool\n", " Downloading patool-1.12-py2.py3-none-any.whl (77 kB)\n", "\u001b[K |████████████████████████████████| 77 kB 3.1 MB/s \n", "\u001b[?25hInstalling collected packages: patool\n", "Successfully installed patool-1.12\n", "[Errno 2] No such file or directory: 'vits-mandarin-biaobei'\n", "/content/vits-mandarin-biaobei\n" ] } ], "source": [ "!pip install pyunpack\n", "!pip install patool\n", "from pyunpack import Archive\n", "%cd vits-mandarin-biaobei\n", "Archive('/content/drive/MyDrive/biaobei.rar').extractall('/content/vits-mandarin-biaobei')" ] }, { "cell_type": "code", "source": [ "!sudo apt-get install sox" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "gB6Bz3KoWYra", "outputId": "ccf53ea4-dd9b-4217-caee-219d7d7c100c" }, "execution_count": 6, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Reading package lists... Done\n", "Building dependency tree \n", "Reading state information... Done\n", "The following package was automatically installed and is no longer required:\n", " libnvidia-common-460\n", "Use 'sudo apt autoremove' to remove it.\n", "The following additional packages will be installed:\n", " libmagic-mgc libmagic1 libopencore-amrnb0 libopencore-amrwb0 libsox-fmt-alsa\n", " libsox-fmt-base libsox3\n", "Suggested packages:\n", " file libsox-fmt-all\n", "The following NEW packages will be installed:\n", " libmagic-mgc libmagic1 libopencore-amrnb0 libopencore-amrwb0 libsox-fmt-alsa\n", " libsox-fmt-base libsox3 sox\n", "0 upgraded, 8 newly installed, 0 to remove and 19 not upgraded.\n", "Need to get 760 kB of archives.\n", "After this operation, 6,717 kB of additional disk space will be used.\n", "Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libopencore-amrnb0 amd64 0.1.3-2.1 [92.0 kB]\n", "Get:2 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libopencore-amrwb0 amd64 0.1.3-2.1 [45.8 kB]\n", "Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic-mgc amd64 1:5.32-2ubuntu0.4 [184 kB]\n", "Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic1 amd64 1:5.32-2ubuntu0.4 [68.6 kB]\n", "Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libsox3 amd64 14.4.2-3ubuntu0.18.04.1 [226 kB]\n", "Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libsox-fmt-alsa amd64 14.4.2-3ubuntu0.18.04.1 [10.6 kB]\n", "Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libsox-fmt-base amd64 14.4.2-3ubuntu0.18.04.1 [32.1 kB]\n", "Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 sox amd64 14.4.2-3ubuntu0.18.04.1 [101 kB]\n", "Fetched 760 kB in 1s (868 kB/s)\n", "debconf: unable to initialize frontend: Dialog\n", "debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 8.)\n", "debconf: falling back to frontend: Readline\n", "debconf: unable to initialize frontend: Readline\n", "debconf: (This frontend requires a controlling tty.)\n", "debconf: falling back to frontend: Teletype\n", "dpkg-preconfigure: unable to re-open stdin: \n", "Selecting previously unselected package libopencore-amrnb0:amd64.\n", "(Reading database ... 156005 files and directories currently installed.)\n", "Preparing to unpack .../0-libopencore-amrnb0_0.1.3-2.1_amd64.deb ...\n", "Unpacking libopencore-amrnb0:amd64 (0.1.3-2.1) ...\n", "Selecting previously unselected package libopencore-amrwb0:amd64.\n", "Preparing to unpack .../1-libopencore-amrwb0_0.1.3-2.1_amd64.deb ...\n", "Unpacking libopencore-amrwb0:amd64 (0.1.3-2.1) ...\n", "Selecting previously unselected package libmagic-mgc.\n", "Preparing to unpack .../2-libmagic-mgc_1%3a5.32-2ubuntu0.4_amd64.deb ...\n", "Unpacking libmagic-mgc (1:5.32-2ubuntu0.4) ...\n", "Selecting previously unselected package libmagic1:amd64.\n", "Preparing to unpack .../3-libmagic1_1%3a5.32-2ubuntu0.4_amd64.deb ...\n", "Unpacking libmagic1:amd64 (1:5.32-2ubuntu0.4) ...\n", "Selecting previously unselected package libsox3:amd64.\n", "Preparing to unpack .../4-libsox3_14.4.2-3ubuntu0.18.04.1_amd64.deb ...\n", "Unpacking libsox3:amd64 (14.4.2-3ubuntu0.18.04.1) ...\n", "Selecting previously unselected package libsox-fmt-alsa:amd64.\n", "Preparing to unpack .../5-libsox-fmt-alsa_14.4.2-3ubuntu0.18.04.1_amd64.deb ...\n", "Unpacking libsox-fmt-alsa:amd64 (14.4.2-3ubuntu0.18.04.1) ...\n", "Selecting previously unselected package libsox-fmt-base:amd64.\n", "Preparing to unpack .../6-libsox-fmt-base_14.4.2-3ubuntu0.18.04.1_amd64.deb ...\n", "Unpacking libsox-fmt-base:amd64 (14.4.2-3ubuntu0.18.04.1) ...\n", "Selecting previously unselected package sox.\n", "Preparing to unpack .../7-sox_14.4.2-3ubuntu0.18.04.1_amd64.deb ...\n", "Unpacking sox (14.4.2-3ubuntu0.18.04.1) ...\n", "Setting up libmagic-mgc (1:5.32-2ubuntu0.4) ...\n", "Setting up libmagic1:amd64 (1:5.32-2ubuntu0.4) ...\n", "Setting up libopencore-amrnb0:amd64 (0.1.3-2.1) ...\n", "Setting up libopencore-amrwb0:amd64 (0.1.3-2.1) ...\n", "Setting up libsox3:amd64 (14.4.2-3ubuntu0.18.04.1) ...\n", "Setting up libsox-fmt-base:amd64 (14.4.2-3ubuntu0.18.04.1) ...\n", "Setting up libsox-fmt-alsa:amd64 (14.4.2-3ubuntu0.18.04.1) ...\n", "Setting up sox (14.4.2-3ubuntu0.18.04.1) ...\n", "Processing triggers for libc-bin (2.27-3ubuntu1.5) ...\n", "Processing triggers for man-db (2.8.3-2ubuntu0.1) ...\n", "Processing triggers for mime-support (3.60ubuntu1) ...\n" ] } ] }, { "cell_type": "code", "source": [ "%cd /content/vits-mandarin-biaobei/biaobei" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "UQT4d7zqcaF5", "outputId": "d314f364-f619-4f08-d81c-099eaa3c9e33" }, "execution_count": 7, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/vits-mandarin-biaobei/biaobei\n" ] } ] }, { "cell_type": "code", "source": [ "%%bash\n", "for x in ./*.wav\n", "do \n", " b=${x##*/}\n", " sox $b -r 22050 tmp_$b\n", " rm -rf $b\n", " mv tmp_$b $b\n", "done" ], "metadata": { "id": "5E0ENKZiduQ-" }, "execution_count": 8, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "LY9d2hgjmYUF" }, "source": [ "# Alignment" ] }, { "cell_type": "code", "source": [ "import os\n", "path = \"/content/vits-mandarin-biaobei\"\n", "os.chdir(path)\n", "print(os.getcwd())" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "L-pAq7ppSp-Z", "outputId": "e02edc31-4328-48eb-c7c6-47d61753c8ac" }, "execution_count": 10, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/vits-mandarin-biaobei\n" ] } ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "LOsV22D8IUTS", "outputId": "6c049fb4-4e1e-4d4d-f32d-e373bcd1607e" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/vits-mandarin-biaobei/monotonic_align\n", "Compiling core.pyx because it changed.\n", "[1/1] Cythonizing core.pyx\n", "/usr/local/lib/python3.7/dist-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /content/vits-mandarin-biaobei/monotonic_align/core.pyx\n", " tree = Parsing.p_module(s, pxd, full_module_name)\n", "running build_ext\n", "building 'monotonic_align.core' extension\n", "creating build\n", "creating build/temp.linux-x86_64-3.7\n", "x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.7/dist-packages/numpy/core/include -I/usr/include/python3.7m -c core.c -o build/temp.linux-x86_64-3.7/core.o\n", "creating /content/vits-mandarin-biaobei/monotonic_align/monotonic_align\n", "x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.7/core.o -o /content/vits-mandarin-biaobei/monotonic_align/monotonic_align/core.cpython-37m-x86_64-linux-gnu.so\n", "/content/vits-mandarin-biaobei\n" ] } ], "source": [ "%cd monotonic_align\n", "!python setup.py build_ext --inplace\n", "%cd .." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "5feIfJWdRNRB", "outputId": "f28f9e51-9a5a-49e5-93d6-91a97b8f59c9" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/vits-mandarin-biaobei\n" ] } ], "source": [ "import os\n", "path = \"/content/vits-mandarin-biaobei\"\n", "os.chdir(path)\n", "print(os.getcwd())" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "JXYOrkJmRuSh", "outputId": "9cbff4b0-58d3-498c-96d4-57131dc5512d" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "START: /content/vits-mandarin-biaobei/filelists/train_filelist.txt\n", "START: /content/vits-mandarin-biaobei/filelists/val_filelist.txt\n" ] } ], "source": [ "!python preprocess.py --text_index 1 --text_cleaners chinese_cleaners1 --filelists /content/vits-mandarin-biaobei/filelists/train_filelist.txt /content/vits-mandarin-biaobei/filelists/val_filelist.txt" ] }, { "cell_type": "markdown", "metadata": { "id": "gjIAR_UsmPEz" }, "source": [ "# Train" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "MrV5GulH3us_", "outputId": "6220e7c7-bb5d-4218-b807-a5b6bfea49c7" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "[INFO] {'train': {'log_interval': 200, 'eval_interval': 1000, 'seed': 1234, 'epochs': 200, 'learning_rate': 0.0002, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 24, 'fp16_run': True, 'lr_decay': 0.999875, 'segment_size': 8192, 'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0}, 'data': {'training_files': 'filelists/train_filelist.txt.cleaned', 'validation_files': 'filelists/val_filelist.txt.cleaned', 'text_cleaners': ['chinese_cleaners1'], 'max_wav_value': 32768.0, 'sampling_rate': 22050, 'filter_length': 1024, 'hop_length': 256, 'win_length': 1024, 'n_mel_channels': 80, 'mel_fmin': 0.0, 'mel_fmax': None, 'add_blank': True, 'n_speakers': 0, 'cleaned_text': True}, 'model': {'inter_channels': 192, 'hidden_channels': 192, 'filter_channels': 768, 'n_heads': 2, 'n_layers': 6, 'kernel_size': 3, 'p_dropout': 0.1, 'resblock': '1', 'resblock_kernel_sizes': [3, 7, 11], 'resblock_dilation_sizes': [[1, 3, 5], [1, 3, 5], [1, 3, 5]], 'upsample_rates': [8, 8, 2, 2], 'upsample_initial_channel': 512, 'upsample_kernel_sizes': [16, 16, 4, 4], 'n_layers_q': 3, 'use_spectral_norm': False}, 'model_dir': './logs/biaobei_base'}\n", "./logs/biaobei_base/G_0.pth\n", "[INFO] Loaded checkpoint './logs/biaobei_base/G_0.pth' (iteration 1)\n", "./logs/biaobei_base/D_0.pth\n", "[INFO] Loaded checkpoint './logs/biaobei_base/D_0.pth' (iteration 1)\n", "/usr/local/lib/python3.7/dist-packages/torch/functional.py:607: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at ../aten/src/ATen/native/SpectralOps.cpp:800.)\n", " normalized, onesided, return_complex)\n", "/usr/local/lib/python3.7/dist-packages/torch/functional.py:607: UserWarning: ComplexHalf support is experimental and many operators don't support it yet. (Triggered internally at ../aten/src/ATen/EmptyTensor.cpp:31.)\n", " normalized, onesided, return_complex)\n", "/usr/local/lib/python3.7/dist-packages/torch/autograd/__init__.py:175: UserWarning: Grad strides do not match bucket view strides. This may indicate grad was not created according to the gradient layout contract, or that the param's strides changed since DDP was constructed. This is not an error, but may impair performance.\n", "grad.sizes() = [1, 9, 96], strides() = [46944, 96, 1]\n", "bucket_view.sizes() = [1, 9, 96], strides() = [864, 96, 1] (Triggered internally at ../torch/csrc/distributed/c10d/reducer.cpp:312.)\n", " allow_unreachable=True, accumulate_grad=True) # Calls into the C++ engine to run the backward pass\n", "[INFO] Train Epoch: 1 [0%]\n", "[INFO] [6.084116458892822, 6.0839314460754395, 0.29333028197288513, 89.30412292480469, 1.4348154067993164, 156.98046875, 0, 0.0002]\n", "/usr/local/lib/python3.7/dist-packages/torch/functional.py:607: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at ../aten/src/ATen/native/SpectralOps.cpp:800.)\n", " normalized, onesided, return_complex)\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 1 to ./logs/biaobei_base/G_0.pth\n", "[INFO] Saving model and optimizer state at iteration 1 to ./logs/biaobei_base/D_0.pth\n", "[INFO] Train Epoch: 1 [50%]\n", "[INFO] [2.4417457580566406, 2.3982975482940674, 2.748124837875366, 43.192771911621094, 1.5272194147109985, 1.9969310760498047, 200, 0.0002]\n", "/usr/local/lib/python3.7/dist-packages/torch/functional.py:607: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at ../aten/src/ATen/native/SpectralOps.cpp:800.)\n", " normalized, onesided, return_complex)\n", "/usr/local/lib/python3.7/dist-packages/torch/functional.py:607: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at ../aten/src/ATen/native/SpectralOps.cpp:800.)\n", " normalized, onesided, return_complex)\n", "/usr/local/lib/python3.7/dist-packages/torch/functional.py:607: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at ../aten/src/ATen/native/SpectralOps.cpp:800.)\n", " normalized, onesided, return_complex)\n", "/usr/local/lib/python3.7/dist-packages/torch/functional.py:607: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at ../aten/src/ATen/native/SpectralOps.cpp:800.)\n", " normalized, onesided, return_complex)\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 1\n", "[INFO] Train Epoch: 2 [1%]\n", "[INFO] [1.4412362575531006, 3.7378997802734375, 6.991755485534668, 37.147499084472656, 1.432862639427185, 1.5886093378067017, 400, 0.000199975]\n", "[INFO] Train Epoch: 2 [51%]\n", "[INFO] [2.536994457244873, 2.6759510040283203, 3.281309127807617, 33.389408111572266, 1.4817153215408325, 1.5160833597183228, 600, 0.000199975]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 2\n", "[INFO] Train Epoch: 3 [1%]\n", "[INFO] [2.409064292907715, 2.3073856830596924, 3.3189518451690674, 35.795204162597656, 1.4083104133605957, 1.9691193103790283, 800, 0.000199950003125]\n", "[INFO] Train Epoch: 3 [51%]\n", "[INFO] [2.746138095855713, 1.787191390991211, 2.5603747367858887, 33.32743453979492, 1.3997528553009033, 1.5535820722579956, 1000, 0.000199950003125]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 3 to ./logs/biaobei_base/G_1000.pth\n", "[INFO] Saving model and optimizer state at iteration 3 to ./logs/biaobei_base/D_1000.pth\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 3\n", "[INFO] Train Epoch: 4 [2%]\n", "[INFO] [2.419834852218628, 2.0565052032470703, 2.996807336807251, 33.93955612182617, 1.4203672409057617, 1.6924939155578613, 1200, 0.00019992500937460937]\n", "[INFO] Train Epoch: 4 [52%]\n", "[INFO] [2.9197604656219482, 1.9120299816131592, 2.43605375289917, 30.982423782348633, 1.4912872314453125, 1.4987608194351196, 1400, 0.00019992500937460937]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 4\n", "[INFO] Train Epoch: 5 [2%]\n", "[INFO] [2.4966511726379395, 2.3101582527160645, 3.0514235496520996, 29.65100860595703, 1.5399270057678223, 2.0126428604125977, 1600, 0.00019990001874843754]\n", "[INFO] Train Epoch: 5 [52%]\n", "[INFO] [2.5708014965057373, 1.7448824644088745, 2.274507522583008, 26.66349983215332, 1.4470289945602417, 1.6776108741760254, 1800, 0.00019990001874843754]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 5\n", "[INFO] Train Epoch: 6 [3%]\n", "[INFO] [2.825239419937134, 2.100724220275879, 2.29148006439209, 27.370080947875977, 1.4402334690093994, 1.7556214332580566, 2000, 0.00019987503124609398]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 6 to ./logs/biaobei_base/G_2000.pth\n", "[INFO] Saving model and optimizer state at iteration 6 to ./logs/biaobei_base/D_2000.pth\n", "[INFO] Train Epoch: 6 [53%]\n", "[INFO] [2.5783028602600098, 1.7449078559875488, 2.479212999343872, 25.641738891601562, 1.511744737625122, 1.7865135669708252, 2200, 0.00019987503124609398]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 6\n", "[INFO] Train Epoch: 7 [3%]\n", "[INFO] [2.640836477279663, 1.7572307586669922, 2.705371618270874, 26.70126724243164, 1.527987003326416, 1.9366952180862427, 2400, 0.0001998500468671882]\n", "[INFO] Train Epoch: 7 [53%]\n", "[INFO] [2.7672274112701416, 1.818725824356079, 1.8327858448028564, 24.210783004760742, 1.4015765190124512, 1.8849365711212158, 2600, 0.0001998500468671882]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 7\n", "[INFO] Train Epoch: 8 [4%]\n", "[INFO] [2.664569616317749, 2.078366994857788, 2.618999481201172, 25.72434425354004, 1.4494619369506836, 1.6781935691833496, 2800, 0.00019982506561132978]\n", "[INFO] Train Epoch: 8 [54%]\n", "[INFO] [2.844681978225708, 1.9013457298278809, 2.220146894454956, 24.32044792175293, 1.3842315673828125, 1.7413629293441772, 3000, 0.00019982506561132978]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 8 to ./logs/biaobei_base/G_3000.pth\n", "[INFO] Saving model and optimizer state at iteration 8 to ./logs/biaobei_base/D_3000.pth\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 8\n", "[INFO] Train Epoch: 9 [4%]\n", "[INFO] [2.700615406036377, 2.292174816131592, 2.384277105331421, 25.27933692932129, 1.3030858039855957, 1.6341955661773682, 3200, 0.00019980008747812837]\n", "[INFO] Train Epoch: 9 [54%]\n", "[INFO] [2.743894338607788, 1.9604068994522095, 2.3496131896972656, 23.112289428710938, 1.2711584568023682, 1.7833446264266968, 3400, 0.00019980008747812837]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 9\n", "[INFO] Train Epoch: 10 [5%]\n", "[INFO] [2.6869912147521973, 1.9352359771728516, 2.5188097953796387, 23.4274845123291, 1.3380227088928223, 1.7740949392318726, 3600, 0.0001997751124671936]\n", "[INFO] Train Epoch: 10 [55%]\n", "[INFO] [2.7764949798583984, 1.6710231304168701, 2.007585048675537, 22.923805236816406, 1.327287197113037, 1.7803704738616943, 3800, 0.0001997751124671936]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 10\n", "[INFO] Train Epoch: 11 [5%]\n", "[INFO] [2.8530619144439697, 1.9538522958755493, 2.505608081817627, 22.968854904174805, 1.324030876159668, 1.7356280088424683, 4000, 0.00019975014057813518]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 11 to ./logs/biaobei_base/G_4000.pth\n", "[INFO] Saving model and optimizer state at iteration 11 to ./logs/biaobei_base/D_4000.pth\n", "[INFO] Train Epoch: 11 [55%]\n", "[INFO] [2.7253758907318115, 1.9672753810882568, 2.2072982788085938, 21.55106544494629, 1.3643673658370972, 1.5139884948730469, 4200, 0.00019975014057813518]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 11\n", "[INFO] Train Epoch: 12 [6%]\n", "[INFO] [2.710725784301758, 1.7867790460586548, 2.1654531955718994, 23.21925926208496, 1.2693941593170166, 1.6313729286193848, 4400, 0.00019972517181056292]\n", "[INFO] Train Epoch: 12 [56%]\n", "[INFO] [2.6724307537078857, 1.7789229154586792, 2.391763210296631, 23.39394760131836, 1.2505900859832764, 1.7837204933166504, 4600, 0.00019972517181056292]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 12\n", "[INFO] Train Epoch: 13 [6%]\n", "[INFO] [2.737412214279175, 1.8569896221160889, 2.2427494525909424, 22.143415451049805, 1.2883596420288086, 1.5434919595718384, 4800, 0.0001997002061640866]\n", "[INFO] Train Epoch: 13 [56%]\n", "[INFO] [2.7240333557128906, 1.6929125785827637, 2.2408742904663086, 22.582965850830078, 1.2616945505142212, 1.6578495502471924, 5000, 0.0001997002061640866]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 13 to ./logs/biaobei_base/G_5000.pth\n", "[INFO] Saving model and optimizer state at iteration 13 to ./logs/biaobei_base/D_5000.pth\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 13\n", "[INFO] Train Epoch: 14 [7%]\n", "[INFO] [2.795337200164795, 1.6596165895462036, 2.3774819374084473, 21.676546096801758, 1.2574995756149292, 1.6747722625732422, 5200, 0.00019967524363831608]\n", "[INFO] Train Epoch: 14 [57%]\n", "[INFO] [2.8059263229370117, 1.859124779701233, 2.100916862487793, 20.741226196289062, 1.2215628623962402, 1.4731595516204834, 5400, 0.00019967524363831608]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 14\n", "[INFO] Train Epoch: 15 [7%]\n", "[INFO] [2.774426221847534, 1.9955708980560303, 2.383021354675293, 21.531986236572266, 1.3024400472640991, 1.789406657218933, 5600, 0.0001996502842328613]\n", "[INFO] Train Epoch: 15 [57%]\n", "[INFO] [2.802056312561035, 1.8395187854766846, 2.1710376739501953, 21.044178009033203, 1.250455617904663, 1.8578144311904907, 5800, 0.0001996502842328613]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 15\n", "[INFO] Train Epoch: 16 [8%]\n", "[INFO] [2.6887869834899902, 1.9888904094696045, 2.2489898204803467, 21.914621353149414, 1.2303470373153687, 1.6883699893951416, 6000, 0.00019962532794733217]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 16 to ./logs/biaobei_base/G_6000.pth\n", "[INFO] Saving model and optimizer state at iteration 16 to ./logs/biaobei_base/D_6000.pth\n", "[INFO] Train Epoch: 16 [58%]\n", "[INFO] [2.734205484390259, 1.6239826679229736, 2.353121519088745, 21.414894104003906, 1.2701444625854492, 1.7555757761001587, 6200, 0.00019962532794733217]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 16\n", "[INFO] Train Epoch: 17 [8%]\n", "[INFO] [2.7895848751068115, 1.9784533977508545, 2.0921571254730225, 21.534574508666992, 1.2579307556152344, 1.75993013381958, 6400, 0.00019960037478133875]\n", "[INFO] Train Epoch: 17 [58%]\n", "[INFO] [2.924771785736084, 1.8922921419143677, 2.0394113063812256, 21.05266571044922, 1.2261463403701782, 1.6322624683380127, 6600, 0.00019960037478133875]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 17\n", "[INFO] Train Epoch: 18 [9%]\n", "[INFO] [2.8778138160705566, 1.7331665754318237, 2.13059663772583, 20.085569381713867, 1.2867584228515625, 1.8014692068099976, 6800, 0.00019957542473449108]\n", "[INFO] Train Epoch: 18 [59%]\n", "[INFO] [2.9135074615478516, 1.844761610031128, 2.3517770767211914, 22.37508201599121, 1.2295209169387817, 1.6714726686477661, 7000, 0.00019957542473449108]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 18 to ./logs/biaobei_base/G_7000.pth\n", "[INFO] Saving model and optimizer state at iteration 18 to ./logs/biaobei_base/D_7000.pth\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 18\n", "[INFO] Train Epoch: 19 [9%]\n", "[INFO] [2.743447780609131, 1.7904363870620728, 2.642989158630371, 22.002586364746094, 1.2774255275726318, 1.89876127243042, 7200, 0.00019955047780639926]\n", "[INFO] Train Epoch: 19 [59%]\n", "[INFO] [2.7805516719818115, 1.9519226551055908, 2.4283533096313477, 20.12021255493164, 1.234122633934021, 1.6406763792037964, 7400, 0.00019955047780639926]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 19\n", "[INFO] Train Epoch: 20 [10%]\n", "[INFO] [2.7074551582336426, 1.802383542060852, 2.4140470027923584, 21.853384017944336, 1.2304021120071411, 1.7317063808441162, 7600, 0.00019952553399667344]\n", "[INFO] Train Epoch: 20 [60%]\n", "[INFO] [2.8339757919311523, 1.8614946603775024, 2.1415278911590576, 20.868751525878906, 1.253136396408081, 1.5782139301300049, 7800, 0.00019952553399667344]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 20\n", "[INFO] Train Epoch: 21 [10%]\n", "[INFO] [2.698446750640869, 1.8610132932662964, 2.6437385082244873, 19.71364974975586, 1.1622449159622192, 1.463873267173767, 8000, 0.00019950059330492385]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 21 to ./logs/biaobei_base/G_8000.pth\n", "[INFO] Saving model and optimizer state at iteration 21 to ./logs/biaobei_base/D_8000.pth\n", "[INFO] Train Epoch: 21 [60%]\n", "[INFO] [2.6374335289001465, 2.05804705619812, 2.536536455154419, 22.417245864868164, 1.24099862575531, 1.7765955924987793, 8200, 0.00019950059330492385]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 21\n", "[INFO] Train Epoch: 22 [11%]\n", "[INFO] [2.9157843589782715, 1.7263212203979492, 2.1869561672210693, 20.874919891357422, 1.189208984375, 1.5717899799346924, 8400, 0.00019947565573076072]\n", "[INFO] Train Epoch: 22 [61%]\n", "[INFO] [2.711268424987793, 1.8381141424179077, 2.5105741024017334, 22.661685943603516, 1.2553364038467407, 1.701624870300293, 8600, 0.00019947565573076072]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 22\n", "[INFO] Train Epoch: 23 [11%]\n", "[INFO] [2.7569165229797363, 1.788022518157959, 2.6186747550964355, 20.19710922241211, 1.3225374221801758, 1.6863317489624023, 8800, 0.00019945072127379438]\n", "[INFO] Train Epoch: 23 [61%]\n", "[INFO] [2.7659268379211426, 1.8211963176727295, 2.6121342182159424, 20.748703002929688, 1.3593143224716187, 1.6192176342010498, 9000, 0.00019945072127379438]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 23 to ./logs/biaobei_base/G_9000.pth\n", "[INFO] Saving model and optimizer state at iteration 23 to ./logs/biaobei_base/D_9000.pth\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 23\n", "[INFO] Train Epoch: 24 [12%]\n", "[INFO] [2.7761423587799072, 1.7905502319335938, 2.4130306243896484, 20.3702392578125, 1.1943910121917725, 1.9142565727233887, 9200, 0.00019942578993363514]\n", "[INFO] Train Epoch: 24 [62%]\n", "[INFO] [2.840864658355713, 1.7432241439819336, 2.559861660003662, 20.3363037109375, 1.2255221605300903, 1.8656281232833862, 9400, 0.00019942578993363514]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 24\n", "[INFO] Train Epoch: 25 [12%]\n", "[INFO] [2.756883144378662, 1.8775752782821655, 2.4978978633880615, 20.03139305114746, 1.2121849060058594, 1.643437147140503, 9600, 0.00019940086170989343]\n", "[INFO] Train Epoch: 25 [62%]\n", "[INFO] [2.7853052616119385, 1.9367132186889648, 2.5860867500305176, 20.668922424316406, 1.2606821060180664, 1.7472211122512817, 9800, 0.00019940086170989343]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] ====> Epoch: 25\n", "[INFO] Train Epoch: 26 [13%]\n", "[INFO] [2.784014940261841, 1.9044796228408813, 2.601097345352173, 20.373104095458984, 1.2959768772125244, 1.7463055849075317, 10000, 0.0001993759366021797]\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m[INFO] Saving model and optimizer state at iteration 26 to ./logs/biaobei_base/G_10000.pth\n", "[INFO] Saving model and optimizer state at iteration 26 to ./logs/biaobei_base/D_10000.pth\n", "[INFO] Train Epoch: 26 [63%]\n", "[INFO] [2.8207149505615234, 1.8360484838485718, 2.4782183170318604, 20.326980590820312, 1.2672089338302612, 1.595682144165039, 10200, 0.0001993759366021797]\n", "Traceback (most recent call last):\n", " File \"train.py\", line 295, in \n", " main()\n", " File \"train.py\", line 55, in main\n", " mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))\n", " File \"/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py\", line 240, in spawn\n", "\u001b[0m\u001b[0m File \"/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py\", line 198, in start_processes\n", " while not context.join():\n", " File \"/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py\", line 111, in join\n", " timeout=timeout,\n", " File \"/usr/lib/python3.7/multiprocessing/connection.py\", line 921, in wait\n", " ready = selector.select(timeout)\n", " File \"/usr/lib/python3.7/selectors.py\", line 415, in select\n", " fd_event_list = self._selector.poll(timeout)\n", "KeyboardInterrupt\n", "\u001b[0m\u001b[0m\u001b[0m\u001b[0m" ] } ], "source": [ "!python train.py -c configs/biaobei_base.json -m biaobei_base" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "S8gpGR7HUx8w", "outputId": "017ee1ae-1af5-4dc3-831a-d5427c44c710" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/vits-mandarin-biaobei\n" ] } ], "source": [ "#在\"代码执行程序\"下拉菜单选择\"重新启动代码程序\"\n", "#再从该代码框开始,进行推断和输出语音\n", "import os\n", "path = \"/content/vits-mandarin-biaobei\"\n", "os.chdir(path)\n", "print(os.getcwd())\n", "\n", "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "import IPython.display as ipd\n", "\n", "import os\n", "import json\n", "import math\n", "import torch\n", "from torch import nn\n", "from torch.nn import functional as F\n", "from torch.utils.data import DataLoader\n", "\n", "import commons\n", "import utils\n", "from data_utils import TextAudioLoader, TextAudioCollate, TextAudioSpeakerLoader, TextAudioSpeakerCollate\n", "from models import SynthesizerTrn\n", "from text.symbols import symbols\n", "from text import text_to_sequence\n", "\n", "from scipy.io.wavfile import write\n", "\n", "\n", "def get_text(text, hps):\n", " text_norm = text_to_sequence(text, hps.data.text_cleaners)\n", " if hps.data.add_blank:\n", " text_norm = commons.intersperse(text_norm, 0)\n", " text_norm = torch.LongTensor(text_norm)\n", " return text_norm" ] }, { "cell_type": "code", "source": [ "hps = utils.get_hparams_from_file(\"/content/vits-mandarin-biaobei/configs/biaobei_base.json\")" ], "metadata": { "id": "o3OCVb09sM3D" }, "execution_count": 3, "outputs": [] }, { "cell_type": "code", "execution_count": 4, "metadata": { "id": "O3K5fYBnJSfT" }, "outputs": [], "source": [ "net_g = SynthesizerTrn(\n", " len(symbols),\n", " hps.data.filter_length // 2 + 1,\n", " hps.train.segment_size // hps.data.hop_length,\n", " **hps.model).cuda()\n", "_ = net_g.eval()\n", "\n", "_ = utils.load_checkpoint(\"/content/vits-mandarin-biaobei/logs/biaobei_base/G_10000.pth\", net_g, None)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "id": "Q1MxZNQudiPa", "colab": { "base_uri": "https://localhost:8080/", "height": 74 }, "outputId": "406b6e81-9a24-43be-f983-b8911c38fe89" }, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "\n", " \n", " " ] }, "metadata": {} } ], "source": [ "stn_tst = get_text(\"你好,别在这里发癫。\", hps)\n", "with torch.no_grad():\n", " x_tst = stn_tst.cuda().unsqueeze(0)\n", " x_tst_lengths = torch.LongTensor([stn_tst.size(0)]).cuda()\n", " audio = net_g.infer(x_tst, x_tst_lengths, noise_scale=.667, noise_scale_w=0.8, length_scale=1)[0][0,0].data.cpu().float().numpy()\n", "ipd.display(ipd.Audio(audio, rate=hps.data.sampling_rate))" ] }, { "cell_type": "code", "source": [ "#把checkpoint存入google drive\n", "!cp -r /content/vits-mandarin-biaobei/logs/biaobei_base /content/drive/MyDrive/" ], "metadata": { "id": "5Qx691T7K2W8" }, "execution_count": 9, "outputs": [] } ], "metadata": { "accelerator": "GPU", "colab": { "collapsed_sections": [], "name": "“vits.ipynb”的副本", "provenance": [], "machine_shape": "hm" }, "gpuClass": "standard", "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0 }