From 5b641ff0e329cc45c9c23a82cca7a673daf71beb Mon Sep 17 00:00:00 2001 From: Edresson Casanova Date: Wed, 25 May 2022 10:05:28 -0300 Subject: [PATCH] Fix compute embeddings issue --- TTS/bin/compute_embeddings.py | 7 ++----- TTS/tts/utils/managers.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/TTS/bin/compute_embeddings.py b/TTS/bin/compute_embeddings.py index 5426f84a..be862bff 100644 --- a/TTS/bin/compute_embeddings.py +++ b/TTS/bin/compute_embeddings.py @@ -31,11 +31,7 @@ parser.add_argument( ) parser.add_argument("output_path", type=str, help="path for output .json file.") parser.add_argument("--old_file", type=str, help="Previous .json file, only compute for new audios.", default=None) -parser.add_argument("--use_cuda", type=bool, help="flag to set cuda.", default=True) -parser.add_argument( - "--use_predicted_label", type=bool, help="If True and predicted label is available with will use it.", default=False -) -parser.add_argument("--use_cuda", type=bool, help="flag to set cuda. Default False", default=False) +parser.add_argument("--use_cuda", type=bool, help="flag to set cuda.", default=False) parser.add_argument("--no_eval", type=bool, help="Do not compute eval?. Default False", default=False) parser.add_argument( "--use_predicted_label", type=bool, help="If True and predicted label is available with will use it.", default=False @@ -59,6 +55,7 @@ encoder_manager = EmbeddingManager( use_cuda=args.use_cuda, ) +print("Using CUDA?", args.use_cuda) class_name_key = encoder_manager.encoder_config.class_name_key # compute speaker embeddings diff --git a/TTS/tts/utils/managers.py b/TTS/tts/utils/managers.py index 6ea38418..13f02977 100644 --- a/TTS/tts/utils/managers.py +++ b/TTS/tts/utils/managers.py @@ -110,7 +110,7 @@ class EmbeddingManager(BaseIDManager): self.load_embeddings_from_file(embedding_file_path) if encoder_model_path and encoder_config_path: - self.init_encoder(encoder_model_path, encoder_config_path) + self.init_encoder(encoder_model_path, encoder_config_path, use_cuda=use_cuda) @property def embedding_dim(self):