name | about | labels |
---|---|---|
Task | Welcome to all developers! |
There are many ways to use checkpoints during training and fine-tuning tasks.
You can summarize some advanced ways to use it to help other developers to complete training tasks using MindSpore.
The basic checkpoint tutorial can refer to the official website checkpoint tutorial.
For details about how to use function save checkpoint
, please refer to checkpoint.
This task is not affected by the environment and can be executed on the Ascend\GPU\CPU.
Please refer to Document Writing Specifications.
Write checkpoint advanced tutorials.
Then submit the tutorial to https://gitee.com/mindspore/docs/tree/master/tutorials/training/source_zh_cn/advanced_use/advanced_usage_of_checkpoint.md and submit the complete sample code to https://gitee.com/mindspore/docs/tree/master/tutorials/tutorial_code/advanced_usage_of_checkpoint.
The tutorial must contain the following contents:
Do not use the callback function during model.train
, call save_checkpoint
function to save the checkpoint file.
net = resnet()
save_checkpoint(net, "resnet.ckpt")
Filter the specified parameter prefix during checkpoint loading. (use load_checkpoint
)
param_dict = load_checkpoint("resnet.ckpt", filter_prefix="conv1")
Save parameters in the user-defined network (such as sub-network or an optimizer) as a checkpoint file.
config = CheckpointConfig(saved_network=net)
ckpoint_cb = ModelCheckpoint(prefix='LeNet5', config=config)
model.train(10, dataset, callbacks=ckpoint_cb)
Difficult
登录 后才可以发表评论