Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Save weights at any time between integral epochs #8385

Closed
Yochengliu opened this issue Oct 22, 2017 · 4 comments
Closed

Save weights at any time between integral epochs #8385

Yochengliu opened this issue Oct 22, 2017 · 4 comments

Comments

@Yochengliu
Copy link

Yochengliu commented Oct 22, 2017

In caffe, one can save the model weights at any time, for example, in iterations of 32768. Just like pressing 'Ctrl + C', then the training process stops and the model weights are saved automatically.

But in mxnet, I can't find a way like in caffe to save weights at any time, it seems that mxnet can only save weights in integral epochs, such as epoch 1, 2, 3 ...

I feel sorry, because for large-scale datasets, it takes several days for training for one epoch. So, if something wrong, then a lot of time is wasted.

Any solutions for this ? Please in detail.
Thanks.

@solin319
Copy link
Contributor

  1. Try to add follow code after batch_end_callback in 'base_module.py'.
arg_params, aux_params = self.get_params()
if epoch_end_callback is not None:
                for callback in _as_list(epoch_end_callback):
                    callback(nbatch, self.symbol, arg_params, aux_params)
  1. When define 'mx.callback.do_checkpoint', you can pass 'period' to control number of iterations to save checkpoints.

@Yochengliu
Copy link
Author

Yochengliu commented Oct 23, 2017

@solin319 Thank you, I will have a try, and do you know some specific saving ways that just press 'Ctrl + C', then the training process stops and the model weights are saved automatically ?

@szha
Copy link
Member

szha commented Jan 23, 2018

@apache/mxnet-committers: This issue has been inactive for the past 90 days. It has no label and needs triage.

For general "how-to" questions, our user forum (and Chinese version) is a good place to get help.

@lanking520
Copy link
Member

Hi @Yochengliu , I would like to follow up this topic and find someone who can possibly help you. Have you found any ways to meet your needs? @nswamy can you label this as 'feature request'?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants