File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,14 @@ def parse(local_rank, args):
34
34
Parser = args .pop ('Parser' )
35
35
torch .set_num_threads (args .threads )
36
36
torch .manual_seed (args .seed )
37
- init_logger (logger , f"{ args .path } .{ args .mode } .log" , 'a' if args .get ('checkpoint' ) else 'w' )
38
37
if torch .cuda .device_count () > 1 :
39
38
dist .init_process_group (backend = 'nccl' ,
40
39
init_method = f"{ os .environ ['MASTER_ADDR' ]} :{ os .environ ['MASTER_PORT' ]} " ,
41
40
world_size = torch .cuda .device_count (),
42
41
rank = local_rank )
43
42
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' )
44
45
logger .info ('\n ' + str (args ))
45
46
46
47
args .local_rank = local_rank
You can’t perform that action at this time.
0 commit comments