Commit 067d5086 authored by Yang Li's avatar Yang Li Committed by Kai Chen
Browse files

Fix multiple err_msg logging in distribuited mode (#103)

parent c6f2caea
......@@ -93,7 +93,8 @@ def load_state_dict(module, state_dict, strict=False, logger=None):
table = AsciiTable(table_data)
err_msg.append(mismatch_info + table.table)
if len(err_msg) > 0:
rank, _ = get_dist_info()
if len(err_msg) > 0 and rank == 0:
err_msg.insert(
0, 'The model and loaded state dict do not match exactly\n')
err_msg = '\n'.join(err_msg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment