Class for automatically loading a pth file into any architecture
| Method | __init__ |
Undocumented |
| Method | load |
Load a model from the given file path. |
| Method | load |
Load a model from the given state dict. |
| Method | load |
Load the state dict of a model from the given file path. |
| Instance Variable | device |
Undocumented |
| Instance Variable | registry |
The architecture registry to use for loading models. |
| Method | _load |
Undocumented |
| Method | _load |
Undocumented |
| Method | _load |
Undocumented |
str|torch.device|None = None, registry: ArchRegistry = MAIN_REGISTRY):
(source)
¶
Undocumented
Load a model from the given file path.
Throws a ValueError if the file extension is not supported.
Throws an UnsupportedModelError if the model architecture is not supported.
Load a model from the given state dict.
Throws an UnsupportedModelError if the model architecture is not supported.
Load the state dict of a model from the given file path.
State dicts are typically only useful to pass them into the load
function of a specific architecture.
Throws a ValueError if the file extension is not supported.
The architecture registry to use for loading models.
Note: Unless initialized with a custom registry, this is the global main registry (MAIN_REGISTRY).
Modifying this registry will affect all ModelLoader instances without a custom registry.