forked from mindspore-Ecosystem/mindspore
!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:
commit
36f999b213
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue