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

docs(notebook)-issue: Some possible issues in colab notebook of #84. #92

Closed
chitsanfei opened this issue Mar 24, 2023 · 2 comments · Fixed by #93
Closed

docs(notebook)-issue: Some possible issues in colab notebook of #84. #92

chitsanfei opened this issue Mar 24, 2023 · 2 comments · Fixed by #93
Labels
bug Something isn't working

Comments

@chitsanfei
Copy link
Contributor

chitsanfei commented Mar 24, 2023

Describe the bug

Some possible issues in Colab Notebook of #84. Step Training Cluster model and Use trained model

To Reproduce

Issue of Training Cluster model

Directly run Step Training Cluster model:

!svc train-cluster --output-path drive/MyDrive/so-vits-svc-fork/logs/44k

It occurred RuntimeError: File drive/MyDrive/so-vits-svc-fork/logs/44k cannot be opened., which means the output cluster file does not specify a default file name.

May need to be modified to
!svc train-cluster --output-path drive/MyDrive/so-vits-svc-fork/logs/44k/kmeans.pt

Issue of Use trained model (Use trained model (with cluster))

Run

!svc infer-cluster {NAME}.wav -r 0.1 -m drive/MyDrive/so-vits-svc-fork/logs/44k/ -c drive/MyDrive/so-vits-svc-fork/logs/44k/config.json -k drive/MyDrive/so-vits-svc-fork/logs/44k/kmeans.pt
display(Audio(f"{NAME}.out.wav", autoplay=True))

Return

Error: No such command 'infer-cluster'.

This code may need to be changed to:

!svc infer -cluster {NAME}.wav -s speaker -r 0.1 -m drive/MyDrive/so-vits-svc-fork/logs/44k/ -c drive/MyDrive/so-vits-svc-fork/logs/44k/config.json -k drive/MyDrive/so-vits-svc-fork/logs/44k/kmeans.pt
display(Audio(f"{NAME}.out.wav", autoplay=True))

Parameter -cluster needs to be separated from the previous command and it may need to specify -s parameter otherwise
it may occurred ValueError: Speaker None not in ['speaker']

Additional context

Log

Minibatch step 51/478: mean batch inertia: 65.0876693725586, ewa inertia: 65.07667463195396
Minibatch step 52/478: mean batch inertia: 64.66484069824219, ewa inertia: 64.9390382259093
Minibatch step 53/478: mean batch inertia: 65.48490142822266, ewa inertia: 65.12146770344484
Minibatch step 54/478: mean batch inertia: 64.38145446777344, ewa inertia: 64.87415257507425
Converged (lack of improvement in inertia) at step 54/478
Training clusters: 100% 1/1 [00:29<00:00, 29.71s/it]
Traceback (most recent call last):
  File "/usr/local/bin/svc", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/so_vits_svc_fork/__main__.py", line 623, in train_cluster
    main(
  File "/usr/local/lib/python3.9/dist-packages/so_vits_svc_fork/cluster/train_cluster.py", line 86, in main
    torch.save(checkpoint, output_path)
  File "/usr/local/lib/python3.9/dist-packages/torch/serialization.py", line 422, in save
    with _open_zipfile_writer(f) as opened_zipfile:
  File "/usr/local/lib/python3.9/dist-packages/torch/serialization.py", line 309, in _open_zipfile_writer
    return container(name_or_buffer)
  File "/usr/local/lib/python3.9/dist-packages/torch/serialization.py", line 287, in __init__
    super(_open_zipfile_writer_file, self).__init__(torch._C.PyTorchFileWriter(str(name)))
RuntimeError: File drive/MyDrive/so-vits-svc-fork/logs/44k cannot be opened.
[02:42:08] Version: 1.3.0
Usage: svc [OPTIONS] COMMAND [ARGS]...
Try 'svc -h' for help.

Error: No such command 'infer-cluster'.
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-18-347b9ce145ed>](https://localhost:8080/#) in <module>
      1 ##@title Use trained model (with cluster)
      2 get_ipython().system('svc infer-cluster {NAME}.wav -r 0.1 -m drive/MyDrive/so-vits-svc-fork/logs/44k/ -c drive/MyDrive/so-vits-svc-fork/logs/44k/config.json -k drive/MyDrive/so-vits-svc-fork/logs/44k/kmeans.pt')
----> 3 display(Audio(f"{NAME}.out.wav", autoplay=True))

[/usr/local/lib/python3.9/dist-packages/IPython/lib/display.py](https://localhost:8080/#) in __init__(self, data, filename, url, embed, rate, autoplay, normalize, element_id)
    112     def __init__(self, data=None, filename=None, url=None, embed=None, rate=None, autoplay=False, normalize=True, *,
    113                  element_id=None):
--> 114         if filename is None and url is None and data is None:
    115             raise ValueError("No audio data found. Expecting filename, url, or data.")
    116         if embed is False and url is None:

ValueError: rate must be specified when data is a numpy array or list of audio samples.

Running Environment

Fri Mar 24 02:06:17 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.12    Driver Version: 525.85.12    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            Off  | 00000000:00:04.0 Off |                    0 |
| N/A   37C    P8    10W /  70W |      0MiB / 15360MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
@34j
Copy link
Collaborator

34j commented Mar 24, 2023

I think -cluster is unnecessary and this is how it should be. Could you please also experiment with this to see if this works?

!svc infer {NAME}.wav -s speaker -r 0.1 -m drive/MyDrive/so-vits-svc-fork/logs/44k/ -c drive/MyDrive/so-vits-svc-fork/logs/44k/config.json -k drive/MyDrive/so-vits-svc-fork/logs/44k/kmeans.pt

I was fooled by copilot lol.

@chitsanfei
Copy link
Contributor Author

I think -cluster is unnecessary and this is how it should be. Could you please also experiment with this to see if this works?

!svc infer {NAME}.wav -s speaker -r 0.1 -m drive/MyDrive/so-vits-svc-fork/logs/44k/ -c drive/MyDrive/so-vits-svc-fork/logs/44k/config.json -k drive/MyDrive/so-vits-svc-fork/logs/44k/kmeans.pt

I was fooled by copilot lol.

It works. Looking forward to your fix. 😚

@34j 34j closed this as completed in #93 Mar 24, 2023
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

Successfully merging a pull request may close this issue.

2 participants