mirror of https://github.com/coqui-ai/TTS.git
bug fix for partial model initialization, if model is not initialized, it is tried to init model partially with only matching layers in size
This commit is contained in:
parent
481105ccfa
commit
a1fe867371
4
train.py
4
train.py
|
@ -360,7 +360,11 @@ def main(args):
|
||||||
|
|
||||||
if args.restore_path:
|
if args.restore_path:
|
||||||
checkpoint = torch.load(args.restore_path)
|
checkpoint = torch.load(args.restore_path)
|
||||||
|
try:
|
||||||
model.load_state_dict(checkpoint['model'])
|
model.load_state_dict(checkpoint['model'])
|
||||||
|
except:
|
||||||
|
print(" > Partial model initialization.")
|
||||||
|
model_dict = model.state_dict()
|
||||||
# Partial initialization: if there is a mismatch with new and old layer, it is skipped.
|
# Partial initialization: if there is a mismatch with new and old layer, it is skipped.
|
||||||
# 1. filter out unnecessary keys
|
# 1. filter out unnecessary keys
|
||||||
pretrained_dict = {
|
pretrained_dict = {
|
||||||
|
|
Loading…
Reference in New Issue