Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] AttributeError: 'AttrDict' object has no attribute 'generator_model' #428

Closed
dims12 opened this issue Apr 13, 2021 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@dims12
Copy link

dims12 commented Apr 13, 2021

Welcome to the 🐸TTS project! We are excited to see your interest, and appreciate your support!

This repository is governed by the Contributor Covenant Code of Conduct. For more details, see the CODE_OF_CONDUCT.md file.

If you've found a bug, please provide the following information:

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

  1. pip install TTS
  2. tts --text "Это голос дикой планеты" --model_name "tts_models/ru/ruslan/tacotron2-DDC" --vocoder_name "tts_models/ru/ruslan/tacotron2-DDC" --out_path example.wav

Downloading model to /home/dims/.local/share/tts/tts_models--ru--ruslan--tacotron2-DDC
Expected behavior
Should not crash but generate audio

Environment (please complete the following information):

$ python --version
Python 3.8.5
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

  • Exact command to reproduce:
    $ tts --text "Это голос дикой планеты" --model_name "tts_models/ru/ruslan/tacotron2-DDC" --vocoder_name "tts_models/ru/ruslan/tacotron2-DDC" --out_path example.wav

Downloading model to /home/dims/.local/share/tts/tts_models--ru--ruslan--tacotron2-DDC
tts_models/ru/ruslan/tacotron2-DDC is already downloaded.
Using model: Tacotron2
Traceback (most recent call last):
File "/opt/anaconda3/envs/py38/bin/tts", line 8, in
sys.exit(main())
File "/opt/anaconda3/envs/py38/lib/python3.8/site-packages/TTS/bin/synthesize.py", line 188, in main
synthesizer = Synthesizer(model_path, config_path, vocoder_path, vocoder_config_path, args.use_cuda)
File "/opt/anaconda3/envs/py38/lib/python3.8/site-packages/TTS/utils/synthesizer.py", line 49, in init
self.load_vocoder(vocoder_checkpoint, vocoder_config, use_cuda)
File "/opt/anaconda3/envs/py38/lib/python3.8/site-packages/TTS/utils/synthesizer.py", line 102, in load_vocoder
self.vocoder_model = setup_generator(self.vocoder_config)
File "/opt/anaconda3/envs/py38/lib/python3.8/site-packages/TTS/vocoder/utils/generic_utils.py", line 70, in setup_generator
print(" > Generator Model: {}".format(c.generator_model))
AttributeError: 'AttrDict' object has no attribute 'generator_model'

@dims12 dims12 added the bug Something isn't working label Apr 13, 2021
@erogol
Copy link
Member

erogol commented Apr 13, 2021

Thanks for your call @dims12 .

The problem is that you call a tts_model in place of a vocoder_model. That is --vocoder_name should take one of the vocoder we have.

Easy fix would be calling it as

$ tts --text "Это голос дикой планеты" --model_name "tts_models/ru/ruslan/tacotron2-DDC"  --out_path example.wav

then it'd use the default vocoder model set for the given tts model.

@erogol erogol closed this as completed Apr 13, 2021
@loureirorg
Copy link

Thanks, @erogol. That works!

Maybe the instructions on README should be updated to avoid this kind of confusion, which I also ran into.

On the Run a tts and a vocoder model from the released model list. it instructs to use both --model_name and --vocoder_name at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants