Skip to content

Commit

Permalink
Fix "UnboundLocalError: local variable 'ckpt' referenced before assig…
Browse files Browse the repository at this point in the history
…nment"
  • Loading branch information
Vidalnt authored Feb 16, 2024
1 parent 35e5d9f commit 10ec49e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions rvc/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,16 +558,16 @@ def train_and_evaluate(rank, epoch, hps, nets, optims, scaler, loaders, writers,
ckpt = net_g.module.state_dict()
else:
ckpt = net_g.state_dict()
extract_model(
ckpt,
hps.sample_rate,
hps.if_f0,
hps.name,
os.path.join(hps.model_dir, "{}_{}e.pth".format(hps.name, epoch)),
epoch,
hps.version,
hps,
)
extract_model(
ckpt,
hps.sample_rate,
hps.if_f0,
hps.name,
os.path.join(hps.model_dir, "{}_{}e.pth".format(hps.name, epoch)),
epoch,
hps.version,
hps,
)

if rank == 0:
if epoch > 1:
Expand Down

0 comments on commit 10ec49e

Please sign in to comment.