forked from mindspore-Ecosystem/mindspore
!7661 add ckpt code example
Merge pull request !7661 from changzherui/add_ckpt_example
This commit is contained in:
commit
2d6c07a367
|
@ -341,6 +341,11 @@ def load_param_into_net(net, parameter_dict, strict_load=False):
|
|||
|
||||
Raises:
|
||||
TypeError: Argument is not a Cell, or parameter_dict is not a Parameter dictionary.
|
||||
|
||||
Examples:
|
||||
>>> net = LeNet5()
|
||||
>>> param_dict = load_checkpoint("LeNet5-2_1875.ckpt")
|
||||
>>> load_param_into_net(net, param_dict)
|
||||
"""
|
||||
if not isinstance(net, nn.Cell):
|
||||
logger.error("Failed to combine the net and the parameters.")
|
||||
|
|
Loading…
Reference in New Issue