[GH-ISSUE #1044] TextEncoder768 to 256 #687

Closed
opened 2026-10-20 10:01:55 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @artificialnouveau on GitHub (Aug 18, 2023).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/1044

I'm currently getting this error:

Traceback (most recent call last):
File "C:\Users\Anaconda3\envs\rvc-eval\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Anaconda3\envs\rvc-eval\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\rvc-eval\rvc_eval\cli.py", line 222, in
main(args)
File "C:\Users\rvc-eval\rvc_eval\cli.py", line 120, in main
net_g, sampling_ratio = load_net_g(args.model, is_half, device, args.rvcversion)
File "C:\Users\rvc-eval\rvc_eval\model.py", line 58, in load_net_g
net_g.load_state_dict(cpt["weight"], strict=False)
File "C:\Users\Anaconda3\envs\rvc-eval\lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for SynthesizerTrnMs256NSFsid_nono:
size mismatch for enc_p.emb_phone.weight: copying a param with shape torch.Size([192, 768]) from checkpoint, the shape in current model is torch.Size([192, 256]).

The hubert_base.pt has a hidden channels of 768, how does it adapt to the RVC v2 models which has hidden channels set to 256?

Originally created by @artificialnouveau on GitHub (Aug 18, 2023). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/1044 I'm currently getting this error: Traceback (most recent call last): File "C:\Users\Anaconda3\envs\rvc-eval\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Anaconda3\envs\rvc-eval\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\rvc-eval\rvc_eval\cli.py", line 222, in <module> main(args) File "C:\Users\rvc-eval\rvc_eval\cli.py", line 120, in main net_g, sampling_ratio = load_net_g(args.model, is_half, device, args.rvcversion) File "C:\Users\rvc-eval\rvc_eval\model.py", line 58, in load_net_g net_g.load_state_dict(cpt["weight"], strict=False) File "C:\Users\Anaconda3\envs\rvc-eval\lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SynthesizerTrnMs256NSFsid_nono: size mismatch for enc_p.emb_phone.weight: copying a param with shape torch.Size([192, 768]) from checkpoint, the shape in current model is torch.Size([192, 256]). The hubert_base.pt has a hidden channels of 768, how does it adapt to the RVC v2 models which has hidden channels set to 256?
Author
Owner

@RVC-Boss commented on GitHub (Aug 19, 2023):

by linear or conv1d

<!-- gh-comment-id:1684910545 --> @RVC-Boss commented on GitHub (Aug 19, 2023): by linear or conv1d
Author
Owner

@artificialnouveau commented on GitHub (Aug 19, 2023):

I'm still encountered an error when loading weights when I do net_g.load_state_dict(cpt["weight"], strict=False). This only occurs when I load the rvc2 models. Can you propose what to do?

<!-- gh-comment-id:1684936608 --> @artificialnouveau commented on GitHub (Aug 19, 2023): I'm still encountered an error when loading weights when I do net_g.load_state_dict(cpt["weight"], strict=False). This only occurs when I load the rvc2 models. Can you propose what to do?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#687
No description provided.