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

Errors with dependencies and Summary during aligner, duration_extraction and training #100

Closed prajwaljpj closed 3 years ago

prajwaljpj commented 3 years ago

Hello, I get a lot of errors, deprecations warnings of matplotlib, or unable to write a specific summary. It would be great if the author updates the README.md with the matplotlib, tqdm versions in the requirements.txt file.

A more elaborate version of the error:

step 6999:   1%|β–ˆβ–‹                        /home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/librosa/display.py:974: MatplotlibDeprecationWarning: The 'basey' parameter of __init__() has been renamed 'base' since Matplotlib 3.3; support for the old name will be dropped two minor releases later.                                                                                                                                                                                                                                           
  scaler(mode, **kwargs)2.5852911186218264
/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/librosa/display.py:974: MatplotlibDeprecationWarning: The 'linthreshy' parameter of __init__() has been renamed 'linthresh' since Matplotlib 3.3; support for the old name will be dropped two minor releases later.eps average loss: 2.59806739962101 7
  scaler(mode, **kwargs)
/home/ubuntu/projects/TransformerTTS/data/audio.py:76: MatplotlibDeprecationWarning: Passing non-integers as three-element position specification is deprecated since 3.3 and will be removed two minor releases later.
  f.add_subplot(ax)
Catched exception in <function SummaryManager.display_mel at 0x7f8fc7c98310>:
Traceback (most recent call last):
  File "/home/ubuntu/projects/TransformerTTS/utils/decorators.py", line 8, in apply_func
    result = f(*args, **kwargs)
  File "/home/ubuntu/projects/TransformerTTS/utils/logging_utils.py", line 156, in display_mel
    figure = self.audio.display_mel(img, is_normal=True)
  File "/home/ubuntu/projects/TransformerTTS/data/audio.py", line 76, in display_mel
    f.add_subplot(ax)
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/matplotlib/figure.py", line 778, in add_subplot
    ax = subplot_class_factory(projection_class)(self, *args, **pkw)
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/matplotlib/axes/_subplots.py", line 38, in __init__
    self.set_subplotspec(SubplotSpec._from_subplot_args(fig, args))
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/matplotlib/gridspec.py", line 632, in _from_subplot_args
    raise ValueError(
ValueError: Single argument to subplot must be a three-digit integer, not <matplotlib.collections.QuadMesh object at 0x7f8f0632dd90>
Catched exception in <function SummaryManager.display_mel at 0x7f8fc7c98310>:
Traceback (most recent call last):
  File "/home/ubuntu/projects/TransformerTTS/utils/decorators.py", line 8, in apply_func
    result = f(*args, **kwargs)
  File "/home/ubuntu/projects/TransformerTTS/utils/logging_utils.py", line 156, in display_mel
    figure = self.audio.display_mel(img, is_normal=True)
  File "/home/ubuntu/projects/TransformerTTS/data/audio.py", line 76, in display_mel
    f.add_subplot(ax)
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/matplotlib/figure.py", line 778, in add_subplot
    ax = subplot_class_factory(projection_class)(self, *args, **pkw)
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/matplotlib/axes/_subplots.py", line 38, in __init__
    self.set_subplotspec(SubplotSpec._from_subplot_args(fig, args))
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/matplotlib/gridspec.py", line 632, in _from_subplot_args
    raise ValueError(
ValueError: Single argument to subplot must be a three-digit integer, not <matplotlib.collections.QuadMesh object at 0x7f8f0630ec10>

Although the training continues, it fails at random instances.

When it fails this is the error:

                                                             Traceback (most recent call last):
  File "train_tts.py", line 203, in <module>
    out = model.predict(text_line, encode=True)
  File "/home/ubuntu/projects/TransformerTTS/model/models.py", line 516, in predict
    out = self.call(inp,
  File "/home/ubuntu/projects/TransformerTTS/model/models.py", line 487, in call
    mels = self.expand(x, use_durations)
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1012, in __call__
    outputs = call_fn(inputs, *args, **kwargs)
  File "/home/ubuntu/projects/TransformerTTS/model/layers.py", line 473, in call
    tiled = tf.tile(x, [1, 1, max_dim])
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/tensorflow/python/ops/gen_array_ops.py", line 11454, in tile
    return tile_eager_fallback(
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/tensorflow/python/ops/gen_array_ops.py", line 11494, in tile_eager_fallback
    _result = _execute.execute(b"Tile", 1, inputs=_inputs_flat, attrs=_attrs,
  File "/home/ubuntu/.virtualenvs/transformertts/lib/python3.8/site-packages/tensorflow/python/eager/execute.py", line 59, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Expected multiples[2] >= 0, but got -2147483648 [Op:Tile]
step 9999:   2%|β–ˆβ–ˆβ–ˆβ–ˆβ–Ž                                                                                                                                                                                                                    | 4999/255000 [46:06<38:25:57,  1.81it/s]
2021-04-16 11:57:08.389640: W tensorflow/core/kernels/data/generator_dataset_op.cc:107] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated.
         [[{{node PyFunc}}]]

Any help would be appreciated! :)

cfrancesco commented 3 years ago

I fixed matplotlib's version. I have not seen the other error messages before, could you post your pip freeze?

prajwaljpj commented 3 years ago

Fixed! The requirement mentions tensorflow >=2.2.0 and works flawlessly with that version. I was using tensorflow version 2.4. I have not tested with version 2.3 yet. But it does not seem to work with 2.4 even if it is built from source.

taylorlu commented 3 years ago

The reason maybe related to the version of librosa, I solved the problem by downgrade to librosa==0.7.2

cfrancesco commented 3 years ago

@taylorlu Hi, are you on tf 2.4? Also, librosa should already be fixed at 0.7.1, did you upgrade or downgrade from 0.8?

taylorlu commented 3 years ago

Yes, 0.8->0.7.2 fixed the problem, and tf2.4 is ok.

prajwaljpj commented 3 years ago

Interesting! I don't have the resource to test on 2.4 as of now. Will reopen if I face an issue when I test it. Thanks @cfrancesco @taylorlu !