Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot infer trained model #464

Closed
parappanon opened this issue Apr 23, 2023 · 2 comments
Closed

Cannot infer trained model #464

parappanon opened this issue Apr 23, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@parappanon
Copy link

Describe the bug
When I try to use svc vc for real time voice conversion, I get "RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory" after a few seconds and become unable to actually convert the voice I've trained.

The full log I get is the following:

[00:35:19] WARNING  [00:35:19] auto_predict_f0 = True in realtime inference will cause unstable voice pitch, use with caution                                                                                                      __main__.py:389
           INFO     [00:35:19] Since model_path is a directory, use logs/44k/G_3000.pth                                                                                                                                            __main__.py:405
Some weights of the model checkpoint at lengyue233/content-vec-best were not used when initializing HubertModel: ['final_proj.weight', 'final_proj.bias']
- This IS expected if you are initializing HubertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing HubertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
[00:35:21] WARNING  [00:35:21] /home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/so_vits_svc_fork/modules/synthesizers.py:81: UserWarning: Unused arguments: {'n_layers_q': 3, 'use_spectral_norm':      warnings.py:109
                    False}                                                                                                                                                                                                                        
                      warnings.warn(f"Unused arguments: {kwargs}")                                                                                                                                                                                
                                                                                                                                                                                                                                                  
           INFO     [00:35:21] Decoder type: hifi-gan                                                                                                                                                                          synthesizers.py:100
Traceback (most recent call last):
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/bin/svc", line 8, in <module>
    sys.exit(cli())
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/so_vits_svc_fork/__main__.py", line 407, in vc
    realtime(
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/so_vits_svc_fork/inference/main.py", line 106, in realtime
    svc_model = Svc(
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/so_vits_svc_fork/inference/core.py", line 116, in __init__
    self.load_model()
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/so_vits_svc_fork/inference/core.py", line 126, in load_model
    _ = utils.load_checkpoint(self.net_g_path, self.net_g, None)
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/so_vits_svc_fork/utils.py", line 240, in load_checkpoint
    checkpoint_dict = torch.load(f, map_location="cpu", weights_only=True)
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/lib/python3.10/site-packages/torch/serialization.py", line 797, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "/home/parappa/miniconda3/envs/so-vits-svc-fork/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

To Reproduce
Steps to reproduce the behavior:

  • Train a model for 3000 steps on https://colab.research.google.com/drive/1laRNiMSgSw_SxSnuti8oWIuC--RHzAGp
  • Install so-vits-svc-fork manually through miniconda3, using Python 3.10 as the Python version on Devuan GNU/Linux
  • Move the D_XXXX.pth and G_XXXX.pth files to logs/44k/ and the config.json file to configs/44k/config.json
  • Activate the miniconda3 virtual enviroment for so-vits-svc-fork
  • Open up a terminal and input svc vc

Additional context
Add any other context about the problem here.

@parappanon parappanon added the bug Something isn't working label Apr 23, 2023
@34j
Copy link
Collaborator

34j commented Apr 25, 2023

Unfortunately your checkpoint seems to be somewhat broken (this often happens when you stop training while the program is saving the ckpt), use another one.

@34j 34j closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2023
@Penghmed
Copy link

I work offline for inference, where to put lengyue233/content-vec-best on the hard-disk?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants