MockingBird ValueError("loaded state dict contains a parameter group " 使用別人的訓練合成器延續訓練下去都會出錯。

cgh8pdjw  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(46)

D:\MockingBird-0.0.1\MockingBird-0.0.1>python synthesizer_train.py CZC D:\Down\Ai\SV2TTS\synthesizer
Arguments:
run_id: CZC
syn_dir: D:\Down\Ai\SV2TTS\synthesizer
models_dir: synthesizer/saved_models/
save_every: 1000
backup_every: 25000
log_every: 200
force_restart: False
hparams:

Checkpoint path: synthesizer\saved_models\CZC\CZC.pt
Loading training data from: D:\Down\Ai\SV2TTS\synthesizer\train.txt
Using model: Tacotron
Using device: cuda

Initialising Tacotron Model...

Trainable Parameters: 31.948M

Loading weights at synthesizer\saved_models\CZC\CZC.pt
Traceback (most recent call last):
File "D:\MockingBird-0.0.1\MockingBird-0.0.1\synthesizer_train.py", line 37, in
train(**vars(args))
File "D:\MockingBird-0.0.1\MockingBird-0.0.1\synthesizer\train.py", line 114, in train
model.load(weights_fpath, optimizer)
File "D:\MockingBird-0.0.1\MockingBird-0.0.1\synthesizer\models\tacotron.py", line 526, in load
optimizer.load_state_dict(checkpoint["optimizer_state"])
File "C:\Users\chen7\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\optim\optimizer.py", line 201, in load_state_dict
raise ValueError("loaded state dict contains a parameter group "
ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's group

已參考 #209#37 每個訓練合成器也都試過了不是出現不匹配就是出現RuntimeError: Error(s) in loading state_dict for Tacotron
V.0.0.1跟新的兩個版本也都用過,都是一樣不行

ipakzgxi

ipakzgxi2#

导入模型的optimizer的参数维度不一致。

把MockingBird-0.0.1_new/synthesizer/models/tacotron.py中的525,526行注释掉就可以跑了。
if "optimizer_state" in checkpoint and optimizer is not None:
optimizer.load_state_dict(checkpoint["optimizer_state"])

相关问题