Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

IndexError: list index out of range

Open dragonmastercale opened this issue 1 year ago • 4 comments

When clicking on Train or one Click Train, I'm getting the following error, any help would be greatly appreciated!

Process Process-2: Traceback (most recent call last): File "F:\RVC\RVC1006Nvidia\infer\modules\train\train.py", line 213, in run utils.latest_checkpoint_path(hps.model_dir, "D_*.pth"), net_d, optim_d File "F:\RVC\RVC1006Nvidia\infer\lib\train\utils.py", line 213, in latest_checkpoint_path x = f_list[-1] IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "multiprocessing\process.py", line 315, in _bootstrap File "multiprocessing\process.py", line 108, in run File "F:\RVC\RVC1006Nvidia\infer\modules\train\train.py", line 232, in run logger.info( UnboundLocalError: local variable 'logger' referenced before assignment INFO:JimiHendrixV2:<All keys matched successfully> INFO:JimiHendrixV2:loaded pretrained assets/pretrained_v2/f0D40k.pth INFO:JimiHendrixV2:<All keys matched successfully> F:\RVC\RVC1006Nvidia\runtime\lib\site-packages\torch\functional.py:641: UserWarning: stft with return_complex=False is deprecated. In a future pytorch release, stft will return complex tensors for all inputs, and return_complex=False will raise an error. Note: you can still call torch.view_as_real on the complex output to recover the old return format. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\SpectralOps.cpp:867.) return _VF.stft(input, n_fft, hop_length, win_length, window, # type: ignore[attr-defined]

dragonmastercale avatar Jun 13 '24 05:06 dragonmastercale

im the I have the same problem

DEBUG:infer.lib.infer_pack.models:gin_channels: 256, self.spk_embed_dim: 109 Process Process-3: INFO:lxj-test-0:loaded pretrained assets/pretrained_v2/f0G48k.pth Traceback (most recent call last): File "/data/Retrieval-based-Voice-Conversion-WebUI-2.2.231006/infer/modules/train/train.py", line 213, in run utils.latest_checkpoint_path(hps.model_dir, "D_*.pth"), net_d, optim_d File "/data/Retrieval-based-Voice-Conversion-WebUI-2.2.231006/infer/lib/train/utils.py", line 213, in latest_checkpoint_path x = f_list[-1] IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/anaconda3/envs/cosyvoice/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/root/anaconda3/envs/cosyvoice/lib/python3.8/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/data/Retrieval-based-Voice-Conversion-WebUI-2.2.231006/infer/modules/train/train.py", line 232, in run logger.info( UnboundLocalError: local variable 'logger' referenced before assignment /data/Retrieval-based-Voice-Conversion-WebUI-2.2.231006/infer/modules/train/train.py:234: 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. torch.load(hps.pretrainG, map_location="cpu")["model"]

wenluqi avatar Sep 28 '24 11:09 wenluqi

Has no one helped? I am having a similar issue :

2025-02-06 14:12:43 | INFO | main | Execute: "python.exe" infer/modules/train/preprocess.py "d:\bark\bark-with-voice-clone\Retrieval-based-Voice-Conversion-WebUI\CustomTrainedModels\Guillaume" 48000 11 "D:\bark\bark-with-voice-clone\Retrieval-based-Voice-Conversion-WebUI/logs/mi-test" False 3.0 d:\bark\bark-with-voice-clone\Retrieval-based-Voice-Conversion-WebUI\CustomTrainedModels\Guillaume" 48000 11 D:\bark\bark-with-voice-clone\Retrieval-based-Voice-Conversion-WebUI/logs/mi-test False 3.0 Traceback (most recent call last): File "D:\bark\bark-with-voice-clone\Retrieval-based-Voice-Conversion-WebUI\infer\modules\train\preprocess.py", line 11, in sr = int(sys.argv[2]) IndexError: list index out of range

Z3r0shin avatar Feb 06 '25 19:02 Z3r0shin

Also same issue. Installing RVC and re-editing all these scripts and downgrading/upgrading all dependencies all day has me thinking that shit is just broken lol

Traceback (most recent call last):
  File "\Retrieval-based-Voice-Conversion-WebUI\infer\modules\train\train.py", line 211, in run
    utils.latest_checkpoint_path(hps.model_dir, "D_*.pth"), net_d, optim_d
  File "\Retrieval-based-Voice-Conversion-WebUI\infer\lib\train\utils.py", line 213, in latest_checkpoint_path
    x = f_list[-1]
IndexError: list index out of range

Inside the utils.py at line 211-213, I find this:

  f_list = glob.glob(os.path.join(dir_path, regex))
    f_list.sort(key=lambda f: int("".join(filter(str.isdigit, f))))
    x = f_list[-1]

DUMBCAT1986 avatar May 13 '25 00:05 DUMBCAT1986

@DUMBCAT1986 I experienced the same issue

Image

but was able to resolve it using the following steps:

Method

  1. Redownload the models

    • Navigate to the directories:
      assets/pretrained
      assets/pretrained_v2
      
    • Delete all models inside these two directories.
    • Redownload the correct models from the following link and place them in the corresponding directories:
      👉 Hugging Face – lj1995/VoiceConversionWebUI
  2. Reinstall matplotlib with a specific version

    pip install matplotlib==3.9.4
    
    

This worked for me. However, an “Error” message still appears in the WebUI, but I can confirm that everything functions correctly when running from the command line.

Image

Dotinkasra avatar Sep 13 '25 01:09 Dotinkasra