!15469 Only save checkpoint on first device while training mobilenet

From: @c_34
Reviewed-by: @linqingke,@wuxuejian
Signed-off-by: @linqingke
This commit is contained in:
mindspore-ci-bot 2021-04-22 09:52:50 +08:00 committed by Gitee
commit 36f999b213
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ if __name__ == '__main__':
time_cb = TimeMonitor(data_size=step_size)
loss_cb = LossMonitor()
cb = [time_cb, loss_cb]
if config.save_checkpoint:
if config.save_checkpoint and device_id % min(8, args_opt.device_num) == 0:
config_ck = CheckpointConfig(save_checkpoint_steps=config.save_checkpoint_epochs * step_size,
keep_checkpoint_max=config.keep_checkpoint_max)
ckpt_cb = ModelCheckpoint(prefix="mobilenetv1", directory=ckpt_save_dir, config=config_ck)