as-ideas / TransformerTTS

🤖💬 Transformer TTS: Implementation of a non-autoregressive Transformer based neural network for text to speech.
https://as-ideas.github.io/TransformerTTS/
Other
1.13k stars 227 forks source link

All elements in a batch must have the same rank #74

Closed pourfard closed 3 years ago

pourfard commented 4 years ago

Hi,

I'm trying to train the model on another dataset for Persian language. I've created the dataset using create_training_data.py and my dataset is just like ljspeech. But when in run train.py I see the following error:

`starting training from scratch

TRAINING Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/context.py", line 2102, in execution_mode yield File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 758, in _next_internal output_shapes=self._flat_output_shapes) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_dataset_ops.py", line 2610, in iterator_get_next _ops.raise_from_not_ok_status(e, name) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 6843, in raise_from_not_ok_status six.raise_from(core._status_to_exception(e.code, message), None) File "", line 3, in raise_from tensorflow.python.framework.errors_impl.InvalidArgumentError: All elements in a batch must have the same rank as the padded shape for component2: expected rank 1 but got element with rank 2 [Op:IteratorGetNext]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/mahdi/Temp/TTS/TransformerTTS/train_forward.py", line 96, in test_mel, test_phonemes, test_durs, test_fname = valid_dataset.next_batch() File "/home/mahdi/Temp/TTS/TransformerTTS/preprocessing/datasets.py", line 199, in next_batch return next(self.data_iter) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 736, in next return self.next() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 772, in next return self._next_internal() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 764, in _next_internal return structure.from_compatible_tensor_list(self._element_spec, ret) File "/usr/lib/python3.6/contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/context.py", line 2105, in execution_mode executor_new.wait() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/executor.py", line 67, in wait pywrap_tfe.TFE_ExecutorWaitForAllPendingNodes(self._handle) tensorflow.python.framework.errors_impl.InvalidArgumentError: All elements in a batch must have the same rank as the padded shape for component2: expected rank 1 but got element with rank 2

Process finished with exit code 1 `

I don't know what is the problem. Can somebody help me please?

cfrancesco commented 3 years ago

Hi, create_training_data creates the data for the autoregressive session, here you're running train_forward.py, follow the readme please.

Open the issue again if you have troubles with train_autoregressive.py.