You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.train.callback.ModelCheckpoint.txt 1.3 kB

4 years ago
1234567891011121314151617181920212223242526272829303132333435363738
  1. Class mindspore.train.callback.ModelCheckpoint(prefix='CKP', directory=None, config=None)
  2. checkpoint的回调函数。
  3. 在训练过程中调用该方法可以保存训练后的网络参数。
  4. 注:
  5. 在分布式训练场景下,请为每个训练进程指定不同的目录来保存checkpoint文件。否则,可能会训练失败。
  6. 参数:
  7. prefix (str):checkpoint文件的前缀名称。默认值:CKP。
  8. directory (str):保存checkpoint文件的文件夹路径。
  9. 默认情况下,文件保存在当前目录下。默认值:None。
  10. config (CheckpointConfig):checkpoint策略配置。默认值:None。
  11. 异常:
  12. ValueError:如果前缀无效。
  13. TypeError:config不是CheckpointConfig类型。
  14. end(run_context)
  15. 在训练结束后,会保存最后一个step的checkpoint。
  16. 参数:
  17. run_context (RunContext):包含模型的一些基本信息。
  18. latest_ckpt_file_name
  19. 返回最新的checkpoint路径和文件名。
  20. step_end(run_context)
  21. 在step结束时保存checkpoint。
  22. 参数:
  23. run_context (RunContext):包含模型的一些基本信息。