innnky/so-vits-svc

4.0版本关于spk报错AttributeError: 'HParams' object has no attribute 'nen'

Closed this issue · 6 comments

尝试用底模G_0预测和用自己的模型预测都会出现这个问题,看了下源码按理说这个speker只是一个类似于编号的东西?
知识水平有限有点一筹莫展了
Traceback (most recent call last):
File "F:\so-vits-svc-4.0\inference_main.py", line 101, in
main()
File "F:\so-vits-svc-4.0\inference_main.py", line 85, in main
out_audio, out_sr = svc_model.infer(spk, tran, raw_path,
File "F:\so-vits-svc-4.0\inference\infer_tool.py", line 170, in infer
speaker_id = self.spk2id[speaker]
File "F:\so-vits-svc-4.0\utils.py", line 492, in getitem
return getattr(self, key)
AttributeError: 'HParams' object has no attribute 'nen'

顺便还有个问题,就是偶尔迭代的时候会中断,显示报错是:
Traceback (most recent call last):
File "train.py", line 310, in
main()
File "train.py", line 51, in main
mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 198, in start_processes
while not context.join():
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 160, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:

-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 423, in save
_save(obj, opened_zipfile, pickle_module, pickle_protocol)
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 650, in _save
zip_file.write_record(name, storage.data_ptr(), num_bytes)
RuntimeError: [enforce fail at inline_container.cc:445] . PytorchStreamWriter failed writing file data/86: file write failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/root/sovits/so-vits-svc-4.0/train.py", line 119, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d], [optim_g, optim_d], [scheduler_g, scheduler_d], scaler,
File "/root/sovits/so-vits-svc-4.0/train.py", line 243, in train_and_evaluate
utils.save_checkpoint(net_d, optim_d, hps.train.learning_rate, epoch,
File "/root/sovits/so-vits-svc-4.0/utils.py", line 260, in save_checkpoint
torch.save({'model': state_dict,
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 424, in save
return
File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 290, in exit
self.file_like.write_end_of_file()
RuntimeError: [enforce fail at inline_container.cc:325] . unexpected pos 529497152 vs 529497104

第一个问题,你很明显没有严格按readme步骤来,你需要执行preprocess_flist_config
第二个问题,你硬盘爆了,存满了

多谢作者大大,我一会儿看看问题

第一个问题,你很明显没有严格按readme步骤来,你需要执行preprocess_flist_config 第二个问题,你硬盘爆了,存满了

emmm,我按照作者大大你的方法再次执行了一遍,因为我一开始就执行过了preprocess_flist_config,出现了第一个问题,我在想是不是因为我没操作好(因为我的电脑执行第三步python preprocess_hubert_f0会爆显存),所以我这次尝试重新做了一遍整个流程,第三步的话,我是把租来的机器跑出来的dataset整个移到我的项目里,然后用跑出来的模型预测依然会报这个错误,所以是不是并不是没有执行第二部preprocess_flist_config的原因?

第一条我理解错了,你应该是推理的时候没有指定说话人(

嗯嗯,我之前突然发现了,其实这个“nen”就是前文对应的“speaker0”,实在是猪脑过载了,感谢作者大大百忙回答,哈哈哈我的问题。