espnet2.torch_utils.load_pretrained_model.load_pretrained_model
Less than 1 minute
espnet2.torch_utils.load_pretrained_model.load_pretrained_model
espnet2.torch_utils.load_pretrained_model.load_pretrained_model(init_param: str, model: Module, ignore_init_mismatch: bool, map_location: str = 'cpu')
Load a model state and set it to the model.
- Parameters:init_param – <file_path>:<src_key>:<dst_key>:<exclude_Keys>
Examples
>>> load_pretrained_model("somewhere/model.pth", model)
>>> load_pretrained_model("somewhere/model.pth:decoder:decoder", model)
>>> load_pretrained_model("somewhere/model.pth:decoder:decoder:", model)
>>> load_pretrained_model(
... "somewhere/model.pth:decoder:decoder:decoder.embed", model
... )
>>> load_pretrained_model("somewhere/decoder.pth::decoder", model)