Skip to content

Commit

Permalink
Move checkpoint funtions from runner to a new sub-package
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzaida committed Feb 18, 2024
1 parent 4df682b commit 478a80a
Show file tree
Hide file tree
Showing 15 changed files with 1,127 additions and 965 deletions.
34 changes: 34 additions & 0 deletions docs/en/api/checkpoint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. role:: hidden
:class: hidden-section

mmengine.checkpoint
===================================

.. contents:: mmengine.checkpoint
:depth: 2
:local:
:backlinks: top

.. currentmodule:: mmengine.checkpoint

.. autosummary::
:toctree: generated
:nosignatures:
:template: classtemplate.rst

CheckpointLoader

.. autosummary::
:toctree: generated
:nosignatures:

load_checkpoint
save_checkpoint
load_state_dict
get_state_dict
weights_to_cpu
find_latest_checkpoint
get_deprecated_model_names
get_external_models
get_mmcls_models
get_torchvision_models
4 changes: 4 additions & 0 deletions docs/en/api/runner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Loop
Checkpoints
----------------

.. warn::

All functions and classes in this file have been moved to `mmengine.checkpoint`. Please import them from `mmengine.checkpoint`.

.. autosummary::
:toctree: generated
:nosignatures:
Expand Down
1 change: 1 addition & 0 deletions docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ You can switch between Chinese and English documents in the lower-left corner of
mmengine.dataset <api/dataset>
mmengine.infer <api/infer>
mmengine.device <api/device>
mmengine.checkpoint <api/checkpoint>
mmengine.hub <api/hub>
mmengine.logging <api/logging>
mmengine.visualization <api/visualization>
Expand Down
34 changes: 34 additions & 0 deletions docs/zh_cn/api/checkpoint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. role:: hidden
:class: hidden-section

mmengine.checkpoint
===================================

.. contents:: mmengine.checkpoint
:depth: 2
:local:
:backlinks: top

.. currentmodule:: mmengine.checkpoint

.. autosummary::
:toctree: generated
:nosignatures:
:template: classtemplate.rst

CheckpointLoader

.. autosummary::
:toctree: generated
:nosignatures:

load_checkpoint
save_checkpoint
load_state_dict
get_state_dict
weights_to_cpu
find_latest_checkpoint
get_deprecated_model_names
get_external_models
get_mmcls_models
get_torchvision_models
4 changes: 4 additions & 0 deletions docs/zh_cn/api/runner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Loop
Checkpoints
----------------

.. warn::

所有的函数和类在这个文件中已经被移动到 `mmengine.checkpoint`。请从 `mmengine.checkpoint` 导入它们。

.. autosummary::
:toctree: generated
:nosignatures:
Expand Down
1 change: 1 addition & 0 deletions docs/zh_cn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
mmengine.dataset <api/dataset>
mmengine.infer <api/infer>
mmengine.device <api/device>
mmengine.checkpoint <api/checkpoint>
mmengine.hub <api/hub>
mmengine.logging <api/logging>
mmengine.visualization <api/visualization>
Expand Down
14 changes: 14 additions & 0 deletions mmengine/checkpoint/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .io import (get_state_dict, load_checkpoint, load_state_dict,
save_checkpoint, weights_to_cpu)
from .loader import CheckpointLoader
from .utils import (find_latest_checkpoint, get_deprecated_model_names,
get_external_models, get_mmcls_models,
get_torchvision_models)

__all__ = [
'CheckpointLoader', 'find_latest_checkpoint', 'get_deprecated_model_names',
'get_external_models', 'get_mmcls_models', 'get_state_dict',
'get_torchvision_models', 'load_checkpoint', 'load_state_dict',
'save_checkpoint', 'weights_to_cpu'
]
Loading

0 comments on commit 478a80a

Please sign in to comment.