Fix an error in DDP training.

This commit is contained in:
Fangjun Kuang 2021-07-25 22:33:09 +08:00
parent 8055bf31a0
commit 78bb65ed78

View File

@ -214,6 +214,8 @@ def save_checkpoint(
model:
The training model.
"""
if rank != 0:
return
filename = params.exp_dir / f"epoch-{params.cur_epoch}.pt"
save_checkpoint_impl(
filename=filename,