alokprasad / LPCTron

Tacotron2 + LPCNET for complete End-to-End TTS System
93 stars 43 forks source link

Tacotron Training ValueError: cannot reshape array of size 137996 into shape (20) #10

Open LifaSun opened 5 years ago

LifaSun commented 5 years ago

According to procedure, I run: python3 train.py --input_dir ../dataset/training_data --tacotron_input ../dataset/training_data/train.txt --model='Tacotron'

But ValueError: cannot reshape array of size 137996 into shape (20) exists.

--------------in detail---------------- Tacotron training set to a maximum of 500000 steps No model to load at logs-Tacotron/taco_pretrained/ Exception in thread background: Traceback (most recent call last): File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner self.run() File "/usr/lib/python3.5/threading.py", line 862, in run self._target(*self._args, *self._kwargs) File "/new-data/lfsun/accentconversion/tts/LPCTron-master/Tacotron-2/tacotron/feeder.py", line 172, in _enqueue_next_test_group test_batches, r = self.make_test_batches() File "/new-data/lfsun/accentconversion/tts/LPCTron-master/Tacotron-2/tacotron/feeder.py", line 141, in make_test_batches examples = [self._get_test_groups() for i in range(len(self._test_meta))] File "/new-data/lfsun/accentconversion/tts/LPCTron-master/Tacotron-2/tacotron/feeder.py", line 141, in examples = [self._get_test_groups() for i in range(len(self._test_meta))] File "/new-data/lfsun/accentconversion/tts/LPCTron-master/Tacotron-2/tacotron/feeder.py", line 127, in _get_test_groups mel_target = np.resize(mel_target, (-1, self._hparams.num_mels)) File "/new-data/lfsun/python3-env/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 1187, in resize return reshape(a, new_shape) File "/new-data/lfsun/python3-env/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 257, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/new-data/lfsun/python3-env/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 52, in _wrapfunc return getattr(obj, method)(args, **kwds) ValueError: cannot reshape array of size 137996 into shape (20)

Do you know how to figure it out? Thanks!

alokprasad commented 5 years ago

@LifaSun where you able to resolve this?

dmzubr commented 5 years ago

Faced the same problem. Working with project in docker environment.

Successfully prepared data for train for LJSpeech-1.1 And now got an error mentioned above:

Tacotron training set to a maximum of 500000 steps No model to load at logs-Tacotron/taco_pretrained/ Exception in thread background: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/synthesis/LPCTron/Tacotron-2/tacotron/feeder.py", line 172, in _enqueue_next_test_group test_batches, r = self.make_test_batches() File "/synthesis/LPCTron/Tacotron-2/tacotron/feeder.py", line 141, in make_test_batches examples = [self._get_test_groups() for i in range(len(self._test_meta))] File "/synthesis/LPCTron/Tacotron-2/tacotron/feeder.py", line 141, in <listcomp> examples = [self._get_test_groups() for i in range(len(self._test_meta))] File "/synthesis/LPCTron/Tacotron-2/tacotron/feeder.py", line 127, in _get_test_groups mel_target = np.resize(mel_target, (-1, self._hparams.num_mels)) File "/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py", line 1187, in resize return reshape(a, new_shape) File "/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py", line 257, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py", line 52, in _wrapfunc return getattr(obj, method)(*args, **kwds) ValueError: cannot reshape array of size 137996 into shape (20)

My docker file is: `FROM tensorflow/tensorflow:1.13.2-gpu-py3

RUN apt-get update -y

RUN apt install -y ffmpeg libasound2-dev python-pyaudio portaudio19-dev RUN pip install falcon==1.2.0 inflect==0.2.5 librosa==0.5.1 matplotlib==2.0.2 numpy==1.14.0 scipy==1.0.0 tqdm==4.11.2 Unidecode==0.4.20 pyaudio==0.2.11 sounddevice==0.3.10 lws keras`

Curry-AI commented 4 years ago

Try using trainging/mels as training data input,

alkis13 commented 4 years ago

Was anyone able to solve this problem?

MaisyZhang commented 4 years ago

@dmzubr you should use .f32 feature as the tactron input, not direct the audio npy, you can look at the script : training.sh.

MaisyZhang commented 4 years ago

@Mao-JianGuo I think not the the mel input, refer the issue #4

n5-suzuki commented 4 years ago

This issue is happend by ./dump_data -test in feature_extract.sh. You can solve this problem by using _make dumpdata taco=1 instead of _make dumpdata.