fishaudio / fish-diffusion

An easy to understand TTS / SVS / SVC framework
https://diff.fish.audio
MIT License
603 stars 75 forks source link

Inference issue in colab version #99

Closed megablocks closed 1 year ago

megablocks commented 1 year ago

Colab version runs fine through training but when trying to get inference, the following error pops up...Running on local URL: http://127.0.0.1:7860/ Running on public URL: https://0fd4daade2bee2fa34.gradio.live/

This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces Traceback (most recent call last): File "/content/fish-diffusion/tools/hifisinger/inference.py", line 224, in model = HiFiSingerSVCInference(config, args.checkpoint) File "/content/fish-diffusion/tools/hifisinger/inference.py", line 25, in init super().init(config, checkpoint, model_cls=model_cls) File "/content/fish-diffusion/tools/diffusion/inference.py", line 74, in init self.model = load_checkpoint( File "/content/fish-diffusion/fish_diffusion/utils/inference.py", line 19, in load_checkpoint state_dict = torch.load(checkpoint, map_location="cpu") File "/content/env/envs/fish_diffusion/lib/python3.10/site-packages/torch/serialization.py", line 797, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "/content/env/envs/fish_diffusion/lib/python3.10/site-packages/torch/serialization.py", line 283, in init super().init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory Traceback (most recent call last): File "/content/env/envs/fish_diffusion/lib/python3.10/site-packages/gradio/routes.py", line 413, in run_predict with utils.MatplotlibBackendMananger(): File "/content/env/envs/fish_diffusion/lib/python3.10/site-packages/gradio/utils.py", line 788, in exit matplotlib.use(self._original_backend) File "/content/env/envs/fish_diffusion/lib/python3.10/site-packages/matplotlib/init.py", line 1233, in use plt.switch_backend(name) File "/content/env/envs/fish_diffusion/lib/python3.10/site-packages/matplotlib/pyplot.py", line 271, in switch_backend backend_mod = importlib.import_module( File "/content/env/envs/fish_diffusion/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 992, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 992, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'ipykernel'

leng-yue commented 1 year ago

You need to install ipykernel

megablocks commented 1 year ago

yes tried that. see screenshot. https://paste.pics/911bed088f1010560cc3cfc31d022d1e

still no luck.

leng-yue commented 1 year ago

!source /content/env/bin/activate;\ conda activate fish_diffusion;\ pip install ipykernel

A-2-H commented 1 year ago

So the solution is to use the code of @leng-yue and put it in the section "Install Dependencies" it should be:

@title

%cd /content/fish-diffusion !source /content/env/bin/activate;\ conda activate fish_diffusion;\ pip install ipykernel;\ curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -;\ /root/.local/bin/pdm sync;

It worked on my side :]