You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2018/01/03 19:49:40 UTC

[incubator-mxnet] branch master updated: fix trainer: init kvstore before load states (#9224)

This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 728e5c2  fix trainer: init kvstore before load states (#9224)
728e5c2 is described below

commit 728e5c2ff51f3376d4db9f4a1aa34d0903fb7033
Author: Jie Zhang <10...@qq.com>
AuthorDate: Thu Jan 4 03:49:36 2018 +0800

    fix trainer: init kvstore before load states (#9224)
---
 python/mxnet/gluon/trainer.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/python/mxnet/gluon/trainer.py b/python/mxnet/gluon/trainer.py
index 0de1bdd..71c144f 100644
--- a/python/mxnet/gluon/trainer.py
+++ b/python/mxnet/gluon/trainer.py
@@ -223,6 +223,9 @@ class Trainer(object):
         fname : str
             Path to input states file.
         """
+        if not self._kv_initialized:
+            self._init_kvstore()
+
         if self._update_on_kvstore:
             self._kvstore.load_optimizer_states(fname)
             self._optimizer = self._kvstore._updater.optimizer

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].