Skip to content

Commit 3416e47

Browse files
committed
Fix logging level issues
1 parent fa87743 commit 3416e47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

supar/cmds/cmd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ def parse(local_rank, args):
3434
Parser = args.pop('Parser')
3535
torch.set_num_threads(args.threads)
3636
torch.manual_seed(args.seed)
37-
init_logger(logger, f"{args.path}.{args.mode}.log", 'a' if args.get('checkpoint') else 'w')
3837
if torch.cuda.device_count() > 1:
3938
dist.init_process_group(backend='nccl',
4039
init_method=f"{os.environ['MASTER_ADDR']}:{os.environ['MASTER_PORT']}",
4140
world_size=torch.cuda.device_count(),
4241
rank=local_rank)
4342
torch.cuda.set_device(local_rank)
43+
# init logger after dist has been initialized
44+
init_logger(logger, f"{args.path}.{args.mode}.log", 'a' if args.get('checkpoint') else 'w')
4445
logger.info('\n' + str(args))
4546

4647
args.local_rank = local_rank

0 commit comments

Comments
 (0)