做者|facebookresearch
编译|Flin
来源|Githubhtml
class detectron2.checkpoint.Checkpointer(model: torch.nn.modules.module.Module, save_dir: str = '', *, save_to_disk: bool = True, **checkpointables)
源代码:https://detectron2.readthedocs.io/_modules/fvcore/common/checkpoint.html#Checkpointerpython
基类: object网络
能够保存/加载模型以及其余可检查点对象的检查点。机器学习
__init__(model:torch.nn.modules.module.Module,save_dir:str ='',*,save_to_disk:bool = True,** checkpointables )
save(name:str,** kwargs )
load(path:str )
从给定的检查点加载。当路径指向网络文件时,必须在全部级别上调用此函数。函数
参数:学习
save(**extra_data)()
保存的内容 。has_checkpoint()
get_checkpoint_file()
get_all_checkpoint_files()
resume_or_load(path:str,*,resume:bool = True )
若是resume为True,则此方法尝试从最后一个检查点(若是存在)恢复。不然,从给定路径加载检查点。从新开始中断的训练做业时,这颇有用。url
参数:.net
tag_last_checkpoint(last_filename_basename: str)
class detectron2.checkpoint.PeriodicCheckpointer(checkpointer: Any, period: int, max_iter: int = None, max_to_keep: int = None)
源代码:https://detectron2.readthedocs.io/_modules/fvcore/common/checkpoint.html#PeriodicCheckpointercode
基类: objecthtm
按期保存检查点。当 .step(iteration)
被调用时,若是迭代是周期的倍数或达到最大值,,它将在给定的checkpointer上执行checkpointer.save
。
__init__(checkpointer: Any, period: int, max_iter: int = None, max_to_keep: int = None)
step(iteration: int, **kwargs)
在给定的迭代中执行适当的操做。
参数:
Checkpointer.save()
中的相同 。save(name: str, **kwargs)
与相同的论点Checkpointer.save()。使用此方法能够在计划以外手动保存检查点。
参数:
Checkpointer.save()
中的相同.classdetectron2.checkpoint.DetectionCheckpointer(model, save_dir='', *, save_to_disk=None, **checkpointables)
与Checkpointer
相同,但可以处理Detectron和Detectron2模型库中的模型,并将转换应用于旧模型。
原文连接:https://detectron2.readthedocs.io/modules/checkpoint.html
欢迎关注磐创AI博客站:
http://panchuang.net/
sklearn机器学习中文官方文档:
http://sklearn123.com/
欢迎关注磐创博客资源汇总站:
http://docs.panchuang.net/