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

Kernel death on se_extractor.get_se() (demo_part3.ipynb) #322

Closed
gpercem opened this issue Oct 12, 2024 · 2 comments
Closed

Kernel death on se_extractor.get_se() (demo_part3.ipynb) #322

gpercem opened this issue Oct 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@gpercem
Copy link

gpercem commented Oct 12, 2024

Hello. I am using the 3rd example of the notebooks.
I can run 1st and 2nd notebooks perfectly fine but I cannot get to the "Obtain Tone Color Embedding" part of the demo_part3.ipynb.

It gives this message in the VSCode:

The Kernel crashed while executing code in the current cell or a previous cell. 
Please review the code in the cell(s) to identify a possible cause of the failure. 
Click [here](https://aka.ms/vscodeJupyterKernelCrash) for more info. 
View Jupyter [log](command:jupyter.viewOutput) for further details.

I've tried it in jupyter but it gave me the same result.

This is the log of the error:

Cell completed with errors nu [Error]: AssertionError
    at n.execute (<username>\.cursor\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\dist\extension.node.js:297:4958) {
  ename: 'AssertionError',
  evalue: '',
  traceback: [
    '\x1B[1;31m---------------------------------------------------------------------------\x1B[0m',
    '\x1B[1;31mAssertionError\x1B[0m                            Traceback (most recent call last)',
    'Cell \x1B[1;32mIn[2], line 5\x1B[0m\n' +
      '\x1B[0;32m      2\x1B[0m device \x1B[38;5;241m=\x1B[39m \x1B[38;5;124m"\x1B[39m\x1B[38;5;124mcuda:0\x1B[39m\x1B[38;5;124m"\x1B[39m\n' +
      "\x1B[0;32m      3\x1B[0m output_dir \x1B[38;5;241m=\x1B[39m \x1B[38;5;124m'\x1B[39m\x1B[38;5;124moutputs_v2\x1B[39m\x1B[38;5;124m'\x1B[39m\n" +
      "\x1B[1;32m----> 5\x1B[0m tone_color_converter \x1B[38;5;241m=\x1B[39m \x1B[43mToneColorConverter\x1B[49m\x1B[43m(\x1B[49m\x1B[38;5;124;43mf\x1B[39;49m\x1B[38;5;124;43m'\x1B[39;49m\x1B[38;5;132;43;01m{\x1B[39;49;00m\x1B[43mckpt_converter\x1B[49m\x1B[38;5;132;43;01m}\x1B[39;49;00m\x1B[38;5;124;43m/config.json\x1B[39;49m\x1B[38;5;124;43m'\x1B[39;49m\x1B[43m,\x1B[49m\x1B[43m \x1B[49m\x1B[43mdevice\x1B[49m\x1B[38;5;241;43m=\x1B[39;49m\x1B[43mdevice\x1B[49m\x1B[43m)\x1B[49m\n" +
      "\x1B[0;32m      6\x1B[0m tone_color_converter\x1B[38;5;241m.\x1B[39mload_ckpt(\x1B[38;5;124mf\x1B[39m\x1B[38;5;124m'\x1B[39m\x1B[38;5;132;01m{\x1B[39;00mckpt_converter\x1B[38;5;132;01m}\x1B[39;00m\x1B[38;5;124m/checkpoint.pth\x1B[39m\x1B[38;5;124m'\x1B[39m)\n" +
      '\x1B[0;32m      8\x1B[0m os\x1B[38;5;241m.\x1B[39mmakedirs(output_dir, exist_ok\x1B[38;5;241m=\x1B[39m\x1B[38;5;28;01mTrue\x1B[39;00m)\n',
    'File \x1B[1;32md:\\OpenVoice\\openvoice\\api.py:103\x1B[0m, in \x1B[0;36mToneColorConverter.__init__\x1B[1;34m(self, *args, **kwargs)\x1B[0m\n' +
      '\x1B[0;32m    102\x1B[0m \x1B[38;5;28;01mdef\x1B[39;00m \x1B[38;5;21m__init__\x1B[39m(\x1B[38;5;28mself\x1B[39m, \x1B[38;5;241m*\x1B[39margs, \x1B[38;5;241m*\x1B[39m\x1B[38;5;241m*\x1B[39mkwargs):\n' +
      '\x1B[1;32m--> 103\x1B[0m     \x1B[38;5;28msuper\x1B[39m()\x1B[38;5;241m.\x1B[39m\x1B[38;5;21m__init__\x1B[39m(\x1B[38;5;241m*\x1B[39margs, \x1B[38;5;241m*\x1B[39m\x1B[38;5;241m*\x1B[39mkwargs)\n' +
      "\x1B[0;32m    105\x1B[0m     \x1B[38;5;28;01mif\x1B[39;00m kwargs\x1B[38;5;241m.\x1B[39mget(\x1B[38;5;124m'\x1B[39m\x1B[38;5;124menable_watermark\x1B[39m\x1B[38;5;124m'\x1B[39m, \x1B[38;5;28;01mTrue\x1B[39;00m):\n" +
      '\x1B[0;32m    106\x1B[0m         \x1B[38;5;28;01mimport\x1B[39;00m \x1B[38;5;21;01mwavmark\x1B[39;00m\n',
    'File \x1B[1;32md:\\OpenVoice\\openvoice\\api.py:19\x1B[0m, in \x1B[0;36mOpenVoiceBaseClass.__init__\x1B[1;34m(self, config_path, device)\x1B[0m\n' +
      '\x1B[0;32m     15\x1B[0m \x1B[38;5;28;01mdef\x1B[39;00m \x1B[38;5;21m__init__\x1B[39m(\x1B[38;5;28mself\x1B[39m, \n' +
      '\x1B[0;32m     16\x1B[0m             config_path, \n' +
      "\x1B[0;32m     17\x1B[0m             device\x1B[38;5;241m=\x1B[39m\x1B[38;5;124m'\x1B[39m\x1B[38;5;124mcuda:0\x1B[39m\x1B[38;5;124m'\x1B[39m):\n" +
      "\x1B[0;32m     18\x1B[0m     \x1B[38;5;28;01mif\x1B[39;00m \x1B[38;5;124m'\x1B[39m\x1B[38;5;124mcuda\x1B[39m\x1B[38;5;124m'\x1B[39m \x1B[38;5;129;01min\x1B[39;00m device:\n" +
      '\x1B[1;32m---> 19\x1B[0m         \x1B[38;5;28;01massert\x1B[39;00m torch\x1B[38;5;241m.\x1B[39mcuda\x1B[38;5;241m.\x1B[39mis_available()\n' +
      '\x1B[0;32m     21\x1B[0m     hps \x1B[38;5;241m=\x1B[39m utils\x1B[38;5;241m.\x1B[39mget_hparams_from_file(config_path)\n' +
      '\x1B[0;32m     23\x1B[0m     model \x1B[38;5;241m=\x1B[39m SynthesizerTrn(\n' +
      "\x1B[0;32m     24\x1B[0m         \x1B[38;5;28mlen\x1B[39m(\x1B[38;5;28mgetattr\x1B[39m(hps, \x1B[38;5;124m'\x1B[39m\x1B[38;5;124msymbols\x1B[39m\x1B[38;5;124m'\x1B[39m, [])),\n" +
      '\x1B[0;32m     25\x1B[0m         hps\x1B[38;5;241m.\x1B[39mdata\x1B[38;5;241m.\x1B[39mfilter_length \x1B[38;5;241m/\x1B[39m\x1B[38;5;241m/\x1B[39m \x1B[38;5;241m2\x1B[39m \x1B[38;5;241m+\x1B[39m \x1B[38;5;241m1\x1B[39m,\n' +
      '\x1B[0;32m     26\x1B[0m         n_speakers\x1B[38;5;241m=\x1B[39mhps\x1B[38;5;241m.\x1B[39mdata\x1B[38;5;241m.\x1B[39mn_speakers,\n' +
      '\x1B[0;32m     27\x1B[0m         \x1B[38;5;241m*\x1B[39m\x1B[38;5;241m*\x1B[39mhps\x1B[38;5;241m.\x1B[39mmodel,\n' +
      '\x1B[0;32m     28\x1B[0m     )\x1B[38;5;241m.\x1B[39mto(device)\n',
    '\x1B[1;31mAssertionError\x1B[0m: '
  ]
}
02:03:45.391 [error] Disposing session as kernel process died ExitCode: 3221226505, Reason: 

Also, I don't know if it's important or not, these are the messages I am getting in the Initialization section. It completes without error but gives warnings:

[d:\OpenVoice\.venv\lib\site-packages\torch\nn\utils\weight_norm.py:134](file:///D:/OpenVoice/.venv/lib/site-packages/torch/nn/utils/weight_norm.py:134): FutureWarning: `torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`.
  WeightNorm.apply(module, name, dim)
Loaded checkpoint 'checkpoints_v2/converter/checkpoint.pth'
missing/unexpected keys: [] []
[d:\OpenVoice\.venv\lib\site-packages\wavmark\__init__.py:16](file:///D:/OpenVoice/.venv/lib/site-packages/wavmark/__init__.py:16): FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(resume_path, map_location=torch.device('cpu'))
[d:\OpenVoice\openvoice\api.py:36](file:///D:/OpenVoice/openvoice/api.py:36): FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint_dict = torch.load(ckpt_path, map_location=torch.device(self.device))

I've installed both checkpoints 1 and 2 (checkpoints_v2_0417.zip). I am running these in my pip venv. Thanks.

Copy link

dosubot bot commented Oct 12, 2024

Hello, @gpercem! I'm here to help you with your coding issues and questions. If you need assistance, feel free to ask!

The AssertionError you're encountering is likely due to the specified device being a CUDA device ('cuda:0'), but CUDA is not available on your system. This is checked by the assertion:

if 'cuda' in device:
    assert torch.cuda.is_available()

To resolve this, ensure that your system has CUDA installed and that PyTorch is configured to use it. You can check CUDA availability with:

import torch
print(torch.cuda.is_available())

If it returns False, you might need to install CUDA or update your PyTorch installation to a version that supports CUDA.

Additionally, regarding the warnings, they are related to deprecated features and security warnings in PyTorch. While they don't cause the kernel crash, you might want to address them by updating your code to use the recommended methods.

For the kernel dying issue, you might also want to check similar discussions or issues, such as the Kernel died issue, which suggests ensuring that PyTorch can find the bundled cuDNN library by setting the LD_LIBRARY_PATH appropriately [1].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the bug Something isn't working label Oct 12, 2024
@gpercem
Copy link
Author

gpercem commented Oct 14, 2024

Installing it via docker solved the issue. I used #264

@gpercem gpercem closed this as completed Oct 14, 2024
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

1 participant