!9628 optimize example

From: @caozhou_huawei
Reviewed-by: @zh_qh,@kingxian
Signed-off-by: @kingxian
This commit is contained in:
mindspore-ci-bot 2020-12-09 14:15:40 +08:00 committed by Gitee
commit 27b3ab1731
1 changed files with 3 additions and 1 deletions

View File

@ -345,7 +345,9 @@ def load_param_into_net(net, parameter_dict, strict_load=False):
>>> net = Net()
>>> ckpt_file_name = "./checkpoint/LeNet5-1_32.ckpt"
>>> param_dict = load_checkpoint(ckpt_file_name, filter_prefix="conv1")
>>> load_param_into_net(net, param_dict)
>>> param_not_load = load_param_into_net(net, param_dict)
>>> print(param_not_load)
['conv1.weight']
"""
if not isinstance(net, nn.Cell):
logger.error("Failed to combine the net and the parameters.")