piiswrong closed pull request #10559: ensure kv store is initialized when 
saving states
URL: https://github.com/apache/incubator-mxnet/pull/10559

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/mxnet/gluon/trainer.py b/python/mxnet/gluon/trainer.py
index e730fd7cd8b..5ae0e46b7dc 100644
--- a/python/mxnet/gluon/trainer.py
+++ b/python/mxnet/gluon/trainer.py
@@ -210,6 +210,9 @@ def save_states(self, fname):
         assert self._optimizer is not None
+        if not self._kv_initialized:
+            self._init_kvstore()
         if self._update_on_kvstore:
             self._kvstore.save_optimizer_states(fname, dump_optimizer=True)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to