Skip to content

Commit

Permalink
fix: 多显卡训练时logger未赋值引用 (RVC-Project#1722)
Browse files Browse the repository at this point in the history
modified:   infer/modules/train/train.py
  • Loading branch information
ChasonJiang authored Jan 16, 2024
1 parent f6fa0c9 commit 4943490
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ rmvpe.pt

# To set a Python version for the project
.tool-versions

/runtime
/assets/weights/*
ffmpeg.*
ffprobe.*
6 changes: 4 additions & 2 deletions infer/modules/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ def main():
os.environ["MASTER_ADDR"] = "localhost"
os.environ["MASTER_PORT"] = str(randint(20000, 55555))
children = []
logger = utils.get_logger(hps.model_dir)
for i in range(n_gpus):
subproc = mp.Process(
target=run,
args=(i, n_gpus, hps),
args=(i, n_gpus, hps, logger),
)
children.append(subproc)
subproc.start()
Expand All @@ -120,10 +121,11 @@ def run(
rank,
n_gpus,
hps,
logger: logging.Logger
):
global global_step
if rank == 0:
logger = utils.get_logger(hps.model_dir)
# logger = utils.get_logger(hps.model_dir)
logger.info(hps)
# utils.check_git_hash(hps.model_dir)
writer = SummaryWriter(log_dir=hps.model_dir)
Expand Down

0 comments on commit 4943490

Please sign in to comment.