152334H / tortoise-tts-fast

Fast TorToiSe inference (5x or your money back!)
GNU Affero General Public License v3.0
779 stars 179 forks source link

BigVGAN error - clean install #45

Closed eloop001 closed 1 year ago

eloop001 commented 1 year ago

I get the error below. Totally clean install 3.10.2 of python on a VM. I followed the install instructions. It seems it cannot reference the BigGAN lib even though its in the correct folder,¨ `─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /root/tortoise-tts-fast/tortoise/models/vocoder.py:10 in │ │ │ │ 7 from typing import Optional, Callable │ │ 8 from dataclasses import dataclass │ │ 9 try: │ │ ❱ 10 │ from BigVGAN.models import BigVGAN as BVGModel │ │ 11 │ from BigVGAN.env import AttrDict │ │ 12 except ImportError: │ │ 13 │ raise ImportError( │ │ │ │ /root/tortoise-tts-fast/BigVGAN/models.py:14 in │ │ │ │ 11 from torch.nn import Conv1d, ConvTranspose1d, Conv2d │ │ 12 from torch.nn.utils import weight_norm, remove_weight_norm, spectral_norm │ │ 13 │ │ ❱ 14 import activations │ │ 15 from utils import init_weights, get_padding │ │ 16 from alias_free_torch import * │ │ 17 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named 'activations'

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /root/tortoise-tts-fast/scripts/tortoise_tts.py:15 in │ │ │ │ 12 import torchaudio │ │ 13 from simple_parsing import ArgumentParser, field │ │ 14 │ │ ❱ 15 from tortoise.api import MODELS_DIR, TextToSpeech │ │ 16 from tortoise.utils.audio import load_audio │ │ 17 from tortoise.utils.diffusion import SAMPLERS │ │ 18 from tortoise.models.vocoder import VocConf │ │ │ │ /root/tortoise-tts-fast/tortoise/api.py:19 in │ │ │ │ 16 from tortoise.models.cvvp import CVVP │ │ 17 from tortoise.models.diffusion_decoder import DiffusionTts │ │ 18 from tortoise.models.random_latent_generator import RandomLatentConverter │ │ ❱ 19 from tortoise.models.vocoder import VocConf │ │ 20 from tortoise.utils.audio import denormalize_tacotron_mel, wav_to_univnet_mel │ │ 21 from tortoise.utils.diffusion import ( │ │ 22 │ SpacedDiffusion, │ │ │ │ /root/tortoise-tts-fast/tortoise/models/vocoder.py:13 in │ │ │ │ 10 │ from BigVGAN.models import BigVGAN as BVGModel │ │ 11 │ from BigVGAN.env import AttrDict │ │ 12 except ImportError: │ │ ❱ 13 │ raise ImportError( │ │ 14 │ │ "BigVGAN not installed, can't use BigVGAN vocoder\n" │ │ 15 │ │ "Please see the installation instructions on README." │ │ 16 │ ) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ImportError: BigVGAN not installed, can't use BigVGAN vocoder Please see the installation instructions on README.`

RinkeshRana commented 1 year ago

git clone https://github.com/152334H/BigVGAN cd BigVGAN pip install -e . cd ..

eloop001 commented 1 year ago

Thanks. It works :-) BTW, I just found your repo. I have tried for a week to get the original tortoise to run faster. Thanks for all the splendid work you have done. Looking forward to contribute.

RinkeshRana commented 1 year ago

please solve my problem:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ D:\Experiments\tortoise-tts-fast\scripts\tortoise_tts.py:223 in │ │ │ │ 220 │ # app = import_module("app") │ │ 221 │ # sys.exit(app.main()) │ │ 222 │ │ │ ❱ 223 │ from tortoise.inference import ( │ │ 224 │ │ check_pydub, │ │ 225 │ │ get_all_voices, │ │ 226 │ │ get_seed, │ │ │ │ D:\Experiments\tortoise-tts-fast\tortoise\inference.py:167 in │ │ │ │ 164 │ │ 165 from voicefixer import VoiceFixer │ │ 166 │ │ ❱ 167 vfixer = VoiceFixer() │ │ 168 │ │ 169 │ │ 170 def save_gen_with_voicefix(g, fpath, squeeze=True, voicefixer=True): │ │ │ │ C:\Users\rinke\AppData\Roaming\Python\Python39\site-packages\voicefixer\base.py:24 in init │ │ │ │ 21 │ │ │ │ │ │ │ │ By default the checkpoint should be download automatical │ │ 22 │ │ │ │ │ │ │ │ But don't worry! Alternatively you can download it direc │ │ 23 │ │ self._model.load_state_dict( │ │ ❱ 24 │ │ │ torch.load( │ │ 25 │ │ │ │ self.analysis_module_ckpt │ │ 26 │ │ │ ) │ │ 27 │ │ ) │ │ │ │ C:\Users\rinke\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py:777 in load │ │ │ │ 774 │ │ │ # If we want to actually tail call to torch.jit.load, we need to │ │ 775 │ │ │ # reset back to the original position. │ │ 776 │ │ │ orig_position = opened_file.tell() │ │ ❱ 777 │ │ │ with _open_zipfile_reader(opened_file) as opened_zipfile: │ │ 778 │ │ │ │ if _is_torchscript_zip(opened_zipfile): │ │ 779 │ │ │ │ │ warnings.warn("'torch.load' received a zip file that looks like a To │ │ 780 │ │ │ │ │ │ │ │ " dispatching to 'torch.jit.load' (call 'torch.jit.loa │ │ │ │ C:\Users\rinke\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py:282 in │ │ init │ │ │ │ 279 │ │ 280 class _open_zipfile_reader(_opener): │ │ 281 │ def init(self, name_or_buffer) -> None: │ │ ❱ 282 │ │ super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_bu │ │ 283 │ │ 284 │ │ 285 class _open_zipfile_writer_file(_opener): │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

152334H commented 1 year ago

same as #44, dumb thing on my part I have fixed.

The pytorchstreamreader thing is a voicefixer problem. Run ~/.cache/voicefixer/analysis_module/checkpoints/vf.ckpt to nuke the corrupted checkpoint file.