myshell-ai / OpenVoice

Instant voice cloning by MIT and MyShell.
https://research.myshell.ai/open-voice
MIT License
29.8k stars 2.93k forks source link

Kernel crash in cell 3 demo_part3.ipynb openvoice v2 windows. #317

Closed yuyangji closed 1 month ago

yuyangji commented 1 month ago

Running the following code cell 3 will cause the kernel to crash. reference_speaker = 'resources/example_reference.mp3' # This is the voice you want to clone target_se, audio_name = se_extractor.get_se(reference_speaker, tone_color_converter, vad=False)

Cuda is installed correctly

print(f"PyTorch CUDA build version: {torch.version.cuda}")
print("Is CUDA available: ", torch.cuda.is_available())
print("CUDA version: ", torch.version.cuda)
print("cuDNN version: ", torch.backends.cudnn.version())
print("Number of GPUs: ", torch.cuda.device_count())

Output PyTorch CUDA build version: 12.4 Is CUDA available: True CUDA version: 12.4 cuDNN version: 90100 Number of GPUs: 1

Specs Windows 11 RTX 3070

Jupyter log Error

03:29:33.598 [error] Disposing session as kernel process died ExitCode: 3221226505, Reason:


image

dosubot[bot] commented 1 month ago

Hey @yuyangji! I'm here to help you with any bugs, questions, or contributions. If you need assistance, feel free to ask!

To resolve the FileNotFoundError for '/checkpoints_v2/converter/config.json' in cell 3 of demo_part3.ipynb, ensure that the file path is correct and that the file actually exists at the specified location. The error indicates that the file config.json is not found in the directory checkpoints_v2/converter.

Here is the relevant code snippet from cell 3:

ckpt_converter = 'checkpoints_v2/converter'
device = "cuda:0" if torch.cuda.is_available() else "cpu"
output_dir = 'outputs_v2'

tone_color_converter = ToneColorConverter(f'{ckpt_converter}/config.json', device=device)
tone_color_converter.load_ckpt(f'{ckpt_converter}/checkpoint.pth')

os.makedirs(output_dir, exist_ok=True)

Make sure that:

  1. The directory checkpoints_v2/converter exists.
  2. The file config.json is present in the checkpoints_v2/converter directory.

If the file or directory does not exist, you need to create them or place the required files in the correct location. If the paths are correct and the files exist, the code should run without raising a FileNotFoundError [1].

Additionally, you can download the required checkpoints from this link and extract them to the checkpoints_v2 folder. The structure of the checkpoints_v2 directory should be as follows:

checkpoints_v2/
    converter/
        config.json
        checkpoint.pth
    base_speakers/
        ses/
            (various .pth files for different speakers)

Ensure that the config.json and checkpoint.pth files are correctly placed in the checkpoints_v2/converter directory [2].

To continue talking to Dosu, mention @dosu.

yuyangji commented 1 month ago

I've found the solution to this issue! Closing this now. Thanks to @freegithuber

gredin commented 1 month ago

@yuyangji Could you explain your solution?

gredin commented 1 month ago

P.S. This worked for me: https://github.com/myshell-ai/OpenVoice/issues/186#issuecomment-2121045158