coqui-ai / TTS

🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production
http://coqui.ai
Mozilla Public License 2.0
33.21k stars 4.02k forks source link

[Bug] Voice conversion with your_tts throws an error: AttributeError: 'NoneType' object has no attribute 'voice_conversion' #2528

Closed chigkim closed 1 year ago

chigkim commented 1 year ago

Describe the bug

Voice conversion with your_tts throws an error: AttributeError: 'NoneType' object has no attribute 'voice_conversion'

To Reproduce

tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=True) source = base+"/source.wav" target = base+"/target.wav" out = base+"/output.wav" tts.voice_conversion_to_file(source_wav=source, target_wav=target, file_path=out)

Expected behavior

Produce output.wav.

Logs

/content/TTS/TTS/api.py
 in voice_conversion(self, source_wav, target_wav)
    591                 Path to the target wav file.
    592         """
--> 593         wav = self.voice_converter.voice_conversion(source_wav=source_wav, target_wav=target_wav)
    594         return wav
    595 
AttributeError: 'NoneType' object has no attribute 'voice_conversion'

Environment

aColab with latest from git.

Additional context

No response

rising-entropy commented 1 year ago

Hello! Able to reproduce the same. It's happening because there is no check in place that loads up a VC_model if not found already. Preparing a PR for the same

erogol commented 1 year ago

This is not the intended use

tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=True)
source = base+"/source.wav"
target = base+"/target.wav"
out = base+"/output.wav"
tts.voice_conversion_to_file(source_wav=source, target_wav=target, file_path=out)

YourTTS is not a voice conversion model. It is a TTS model.

chigkim commented 1 year ago

Actually, YourTTS can do both TTS as well as voice conversion! It just doesn't work through API.

"YourTTS: Towards Zero-Shot Multi-Speaker TTS and Zero-Shot Voice Conversion for everyone"

To use the 🐸 TTS released YourTTS model for voice conversion use the following command:
tts --model_name tts_models/multilingual/multi-dataset/your_tts  --speaker_wav target_speaker_wav.wav --reference_wav  target_content_wav.wav --language_idx "en"
Considering the "target_content_wav.wav" as the reference wave file to convert into the voice of the "target_speaker_wav.wav" speaker.
gitmylo commented 1 year ago

So i guess we'll need to do some manual steps to get it working?

VITS does have voice conversion

Plus as mentioned before, the yourtts demo includes voice conversion

VietDo26 commented 3 months ago

Hello! Able to reproduce the same. It's happening because there is no check in place that loads up a VC_model if not found already. Preparing a PR for the same

Hello! Able to reproduce the same. It's happening because there is no check in place that loads up a VC_model if not found already. Preparing a PR for the same

@rising-entropy excuse me, How I can fix this ?