Closed
Description
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.