TensorSpeech / TensorFlowTTS

:stuck_out_tongue_closed_eyes: TensorFlowTTS: Real-Time State-of-the-art Speech Synthesis for Tensorflow 2 (supported including English, French, Korean, Chinese, German and Easy to adapt for other languages)
https://tensorspeech.github.io/TensorFlowTTS/
Apache License 2.0
3.81k stars 811 forks source link

No module named 'tensorflow_tts' #794

Closed cslop3r closed 6 months ago

cslop3r commented 1 year ago

Hi, I've installed TensorFlowTTS with pip but it seems like it doesn't recognize it. If someone could help me please

Here is the full error: from tensorflow_tts.inference import AutoProcessor ModuleNotFoundError: No module named 'tensorflow_tts'

Here is my code: `import soundfile as sf import numpy as np

import tensorflow as tf

from tensorflow_tts.inference import AutoProcessor from tensorflow_tts.inference import TFAutoModel

processor = AutoProcessor.from_pretrained("tensorspeech/tts-tacotron2-synpaflex-fr") tacotron2 = TFAutoModel.from_pretrained("tensorspeech/tts-tacotron2-synpaflex-fr") mb_melgan = TFAutoModel.from_pretrained("tensorspeech/tts-mb_melgan-synpaflex-fr")

text = "Oh, je voudrais tant que tu te souviennes Des jours heureux quand nous étions amis"

input_ids = processor.text_to_sequence(text)

tacotron2 inference (text-to-mel)

decoder_output, mel_outputs, stop_token_prediction, alignment_history = tacotron2.inference( input_ids=tf.expand_dims(tf.convert_to_tensor(input_ids, dtype=tf.int32), 0), input_lengths=tf.convert_to_tensor([len(input_ids)], tf.int32), speaker_ids=tf.convert_to_tensor([0], dtype=tf.int32), )

melgan inference (mel-to-wav)

audio = mb_melgan.inference(mel_outputs)[0, :, 0]

save to file

sf.write('baka.wav', audio, 22050, "PCM_16")`

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.