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

Commit

Permalink
logging when save params and optimizer states (#4534)
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyetx authored and piiswrong committed Jan 5, 2017
1 parent ec78752 commit 1ae2905
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/mxnet/module/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ def save_checkpoint(self, prefix, epoch, save_optimizer_states=False):
Whether to save optimizer states for continue training
"""
self._symbol.save('%s-symbol.json'%prefix)
self.save_params('%s-%04d.params'%(prefix, epoch))
param_name = '%s-%04d.params' % (prefix, epoch)
self.save_params(param_name)
logging.info('Saved checkpoint to \"%s\"', param_name)
if save_optimizer_states:
self.save_optimizer_states('%s-%04d.states'%(prefix, epoch))
state_name = '%s-%04d.states' % (prefix, epoch)
self.save_optimizer_states(state_name)
logging.info('Saved optimizer state to \"%s\"', state_name)

def _reset_bind(self):
"""Internal function to reset binded state."""
Expand Down

0 comments on commit 1ae2905

Please sign in to comment.