Skip to content

Commit

Permalink
fix training
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Sep 14, 2024
1 parent 95c6677 commit 4a2ffbf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rvc/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ def verify_checkpoint_shapes(checkpoint_path, model):
checkpoint = torch.load(checkpoint_path, map_location="cpu")
checkpoint_state_dict = checkpoint["model"]
try:
model_state_dict = model.module.load_state_dict(checkpoint_state_dict)
if hasattr(model, 'module'):
model_state_dict = model.module.load_state_dict(checkpoint_state_dict)
else:
model_state_dict = model.load_state_dict(checkpoint_state_dict)
except RuntimeError:
print("The sample rate of the pretrain doesn't match the selected one")
sys.exit(1)
Expand Down

0 comments on commit 4a2ffbf

Please sign in to comment.