NS2VC icon indicating copy to clipboard operation
NS2VC copied to clipboard

Error in accelerate launch train.py

Open vimalrick opened this issue 2 years ago • 5 comments

Hi, Thanks for the amazing work.

I put the .wav files in dataset. and I process it with the below code, python preprocess.py

It creates dataset_processed folder with contents.

Then I ran 'accelerate config' to generate the config file.

But when I try to train the model, it throws the follwing error. 'ValueError: num_samples should be a positive integer value, but got num_samples=0'

Please help me to solve it. I am an ios developer and new to generative ai.

accelerate launch train.py

Traceback (most recent call last):
  File "E:\AI\NS2VC-vc-v2\train.py", line 3, in <module>
    trainer = Trainer()
              ^^^^^^^^^
  File "E:\AI\NS2VC-vc-v2\model.py", line 824, in __init__
    dl = DataLoader(ds, batch_size = self.cfg['train']['train_batch_size'], shuffle = True, pin_memory = True, num_workers = self.cfg['train']['num_workers'], collate_fn = collate_fn)
ValueError: num_samples should be a positive integer value, but got num_samples=0
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user\anaconda3\Scripts\accelerate.exe\__main__.py", line 7, in <module>
  File "C:\Users\user\anaconda3\Lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
    args.func(args)
  File "C:\Users\user\anaconda3\Lib\site-packages\accelerate\commands\launch.py", line 986, in launch_command
    simple_launcher(args)
  File "C:\Users\user\anaconda3\Lib\site-packages\accelerate\commands\launch.py", line 628, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\user\\anaconda3\\python.exe', 'train.py']' returned non-zero exit status 1.

vimalrick avatar Sep 15 '23 12:09 vimalrick

Maybe your dataset is not placed correctly, I used the glob library to recursively search for .wav files in the folder, ignoring the .wav files in the root directory. You can create a new folder and nest it one level deeper.

adelacvg avatar Sep 18 '23 05:09 adelacvg

Thanks for your reply.

Do I need to change the content in config.json? Because this "training_files": "../vc_dataset_processed", "val_files": "../val_dataset_processed", path doesn't exist.

What should I put in training_files, val_files, train_num_steps?

` "train": {

"train_batch_size":32,
"gradient_accumulate_every": 1,
"train_lr": 0.0001,
"train_num_steps": 1000000,
"ema_update_every": 10,
"ema_decay": 0.995,
"adam_betas": [0.9, 0.99],
"save_and_sample_every":1000,
"timesteps":1000,
"sampling_timesteps":1000,
"results_folder": "results",
"logs_folder" : "logs/vc",
"num_workers": 32,
"eps": 1e-09,
"keep_ckpts": 3,
"all_in_mem": false

}, "data": { "training_files": "../vc_dataset_processed", "val_files": "../val_dataset_processed", "sampling_rate": 24000, "hop_length": 256 },`

vimalrick avatar Sep 19 '23 20:09 vimalrick

Yes, you need to change the directory of train and val to your own path. Training step that larger than 300000 can get a good result.

adelacvg avatar Sep 22 '23 02:09 adelacvg

Yes, you need to change the directory of train and val to your own path. Training step that larger than 300000 can get a good result.

Thanks I understood. I want train a single speaker voice for 'voice conversion'. Could you tell me how many hours of voice data I need to give in training for a good result?

vimalrick avatar Sep 23 '23 06:09 vimalrick

For optimal results, it is advisable to gather as much data as possible about the target speakers and the potential input. My suggestion is to fine-tune on a larger model, preferably for at least ten minutes, to achieve the best performance.

adelacvg avatar Oct 02 '23 12:10 adelacvg