Shortcuts

CheckpointLoader

class mmengine.runner.CheckpointLoader[source]

A general checkpoint loader to manage all schemes.

classmethod load_checkpoint(filename, map_location=None, logger='current')[source]

load checkpoint through URL scheme path.

Parameters
  • filename (str) – checkpoint file name with given prefix

  • map_location (str, optional) – Same as torch.load(). Defaults to None

  • logger (str) – The logger for message. Defaults to ‘current’.

Returns

The loaded checkpoint.

Return type

dict or OrderedDict

classmethod register_scheme(prefixes, loader=None, force=False)[source]

Register a loader to CheckpointLoader.

This method can be used as a normal class method or a decorator.

Parameters
  • prefixes (str or list[str] or tuple[str]) –

  • loader. (The prefix of the registered) –

  • loader (function, optional) – The loader function to be registered. When this method is used as a decorator, loader is None. Defaults to None.

  • force (bool, optional) – Whether to override the loader if the prefix has already been registered. Defaults to False.

Read the Docs v: v0.8.3
Versions
latest
stable
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.