Skip to content

Commit 3410604

Browse files
committed
🎉 Re-new notebook inference, Add pretrained processor json, Update README.
1 parent adafbff commit 3410604

File tree

9 files changed

+228
-132
lines changed

9 files changed

+228
-132
lines changed

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
:zany_face: TensorflowTTS provides real-time state-of-the-art speech synthesis architectures such as Tacotron-2, Melgan, Multiband-Melgan, FastSpeech, FastSpeech2 based-on TensorFlow 2. With Tensorflow 2, we can speed-up training/inference progress, optimizer further by using [fake-quantize aware](https://www.tensorflow.org/model_optimization/guide/quantization/training_comprehensive_guide) and [pruning](https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras), make TTS models can be run faster than real-time and be able to deploy on mobile devices or embedded systems.
2020

2121
## What's new
22+
- 2020/08/18 **(NEW!)** Update [new base processor](https://github.com/TensorSpeech/TensorFlowTTS/blob/master/tensorflow_tts/processor/base_processor.py). Add [AutoProcessor](https://github.com/TensorSpeech/TensorFlowTTS/blob/master/tensorflow_tts/inference/auto_processor.py) and [pretrained processor](https://github.com/TensorSpeech/TensorFlowTTS/blob/master/tensorflow_tts/processor/pretrained/) json file.
2223
- 2020/08/14 **(NEW!)** Support Chinese TTS. Pls see the [colab](https://colab.research.google.com/drive/1YpSHRBRPBI7cnTkQn1UcVTWEQVbsUm1S?usp=sharing). Thank [@azraelkuan](https://github.com/azraelkuan).
2324
- 2020/08/05 **(NEW!)** Support Korean TTS. Pls see the [colab](https://colab.research.google.com/drive/1ybWwOS5tipgPFttNulp77P6DAB5MtiuN?usp=sharing). Thank [@crux153](https://github.com/crux153).
2425
- 2020/07/17 Support MultiGPU for all Trainer.

‎notebooks/fastspeech2_inference.ipynb‎

Lines changed: 53 additions & 33 deletions
Large diffs are not rendered by default.

‎notebooks/fastspeech_inference.ipynb‎

Lines changed: 38 additions & 33 deletions
Large diffs are not rendered by default.

‎notebooks/multiband_melgan_inference.ipynb‎

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,61 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 2,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"name": "stdout",
10+
"output_type": "stream",
11+
"text": [
12+
"Requirement already satisfied: tensorflow-gpu==2.2.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (2.2.0)\n",
13+
"Requirement already satisfied: tensorboard<2.3.0,>=2.2.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (2.2.2)\n",
14+
"Requirement already satisfied: keras-preprocessing>=1.1.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.1.2)\n",
15+
"Requirement already satisfied: wheel>=0.26; python_version >= \"3\" in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (0.34.2)\n",
16+
"Requirement already satisfied: h5py<2.11.0,>=2.10.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (2.10.0)\n",
17+
"Requirement already satisfied: astunparse==1.6.3 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.6.3)\n",
18+
"Requirement already satisfied: six>=1.12.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.15.0)\n",
19+
"Requirement already satisfied: google-pasta>=0.1.8 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (0.2.0)\n",
20+
"Requirement already satisfied: numpy<2.0,>=1.16.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.18.5)\n",
21+
"Requirement already satisfied: wrapt>=1.11.1 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.12.1)\n",
22+
"Requirement already satisfied: scipy==1.4.1; python_version >= \"3\" in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.4.1)\n",
23+
"Requirement already satisfied: opt-einsum>=2.3.2 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (3.3.0)\n",
24+
"Requirement already satisfied: protobuf>=3.8.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (3.12.2)\n",
25+
"Requirement already satisfied: termcolor>=1.1.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.1.0)\n",
26+
"Requirement already satisfied: absl-py>=0.7.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (0.9.0)\n",
27+
"Requirement already satisfied: grpcio>=1.8.6 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (1.30.0)\n",
28+
"Requirement already satisfied: gast==0.3.3 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (0.3.3)\n",
29+
"Requirement already satisfied: tensorflow-estimator<2.3.0,>=2.2.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorflow-gpu==2.2.0) (2.2.0)\n",
30+
"Requirement already satisfied: markdown>=2.6.8 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (3.2.2)\n",
31+
"Requirement already satisfied: google-auth<2,>=1.6.3 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (1.20.0)\n",
32+
"Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (1.7.0)\n",
33+
"Requirement already satisfied: werkzeug>=0.11.15 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (1.0.1)\n",
34+
"Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (0.4.1)\n",
35+
"Requirement already satisfied: setuptools>=41.0.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (49.2.0.post20200714)\n",
36+
"Requirement already satisfied: requests<3,>=2.21.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (2.24.0)\n",
37+
"Requirement already satisfied: importlib-metadata; python_version < \"3.8\" in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (1.7.0)\n",
38+
"Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (0.2.8)\n",
39+
"Requirement already satisfied: cachetools<5.0,>=2.0.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (4.1.1)\n",
40+
"Requirement already satisfied: rsa<5,>=3.1.4; python_version >= \"3.5\" in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (4.6)\n",
41+
"Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (1.3.0)\n",
42+
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (1.25.10)\n",
43+
"Requirement already satisfied: idna<3,>=2.5 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (2.10)\n",
44+
"Requirement already satisfied: chardet<4,>=3.0.2 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (3.0.4)\n",
45+
"Requirement already satisfied: certifi>=2017.4.17 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (2020.6.20)\n",
46+
"Requirement already satisfied: zipp>=0.5 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from importlib-metadata; python_version < \"3.8\"->markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (3.1.0)\n",
47+
"Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (0.4.8)\n",
48+
"Requirement already satisfied: oauthlib>=3.0.0 in /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow-gpu==2.2.0) (3.1.0)\n"
49+
]
50+
}
51+
],
52+
"source": [
53+
"## tensorflow-gpu==2.3.0 bug to load_weight after call inference\n",
54+
"!pip install tensorflow-gpu==2.2.0"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": 3,
660
"metadata": {},
761
"outputs": [],
862
"source": [
@@ -12,15 +66,13 @@
1266
"\n",
1367
"import tensorflow as tf\n",
1468
"\n",
15-
"from tensorflow_tts.configs import MultiBandMelGANGeneratorConfig\n",
16-
"\n",
1769
"from tensorflow_tts.inference import AutoConfig\n",
1870
"from tensorflow_tts.inference import TFAutoModel"
1971
]
2072
},
2173
{
2274
"cell_type": "code",
23-
"execution_count": 2,
75+
"execution_count": 4,
2476
"metadata": {},
2577
"outputs": [],
2678
"source": [
@@ -35,7 +87,7 @@
3587
},
3688
{
3789
"cell_type": "code",
38-
"execution_count": 3,
90+
"execution_count": 5,
3991
"metadata": {},
4092
"outputs": [],
4193
"source": [
@@ -44,7 +96,7 @@
4496
},
4597
{
4698
"cell_type": "code",
47-
"execution_count": 4,
99+
"execution_count": 6,
48100
"metadata": {},
49101
"outputs": [],
50102
"source": [
@@ -53,11 +105,11 @@
53105
},
54106
{
55107
"cell_type": "code",
56-
"execution_count": 5,
108+
"execution_count": 7,
57109
"metadata": {},
58110
"outputs": [],
59111
"source": [
60-
"mb_melgan.load_weights(\"../examples/multiband_melgan/checkpoints/generator-940000.h5\")"
112+
"mb_melgan.load_weights(\"../examples/multiband_melgan/checkpoints/mb_melgan.v1-940K.h5\")"
61113
]
62114
},
63115
{
@@ -69,14 +121,15 @@
69121
},
70122
{
71123
"cell_type": "code",
72-
"execution_count": 6,
124+
"execution_count": 8,
73125
"metadata": {},
74126
"outputs": [
75127
{
76128
"name": "stdout",
77129
"output_type": "stream",
78130
"text": [
79-
"WARNING:tensorflow:Skipping full serialization of Keras layer <tensorflow_tts.models.melgan.TFMelGANGenerator object at 0x7f6088419850>, because it is not built.\n",
131+
"WARNING:tensorflow:Skipping full serialization of Keras layer <tensorflow_tts.models.mb_melgan.TFMBMelGANGenerator object at 0x7fcd99f163d0>, because it is not built.\n",
132+
"WARNING:tensorflow:Skipping full serialization of Keras layer <tensorflow_tts.models.mb_melgan.TFPQMF object at 0x7fcd99c16710>, because it is not built.\n",
80133
"WARNING:tensorflow:From /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages/tensorflow/python/ops/resource_variable_ops.py:1817: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.\n",
81134
"Instructions for updating:\n",
82135
"If using Keras pass *_constraint arguments to layers.\n",
@@ -97,7 +150,7 @@
97150
},
98151
{
99152
"cell_type": "code",
100-
"execution_count": 7,
153+
"execution_count": 9,
101154
"metadata": {},
102155
"outputs": [],
103156
"source": [

0 commit comments

Comments
 (0)