You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/12 17:16:45 UTC

[GitHub] piiswrong closed pull request #11235: fix loading params if ignore_extra is set

piiswrong closed pull request #11235: fix loading params if ignore_extra is set
URL: https://github.com/apache/incubator-mxnet/pull/11235
 
 
   

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/block.py b/python/mxnet/gluon/block.py
index f107da3c8da..7406a5d6c75 100644
--- a/python/mxnet/gluon/block.py
+++ b/python/mxnet/gluon/block.py
@@ -355,7 +355,8 @@ def load_params(self, filename, ctx=None, allow_missing=False,
                     "Parameter '%s' loaded from file '%s' is not present in ParameterDict, " \
                     "which contains parameters %s. Set ignore_extra=True to ignore. "%(
                         name, filename, _brief_print_list(self._params.keys())))
-            params[name]._load_init(loaded[name], ctx)
+            if name in params:
+                params[name]._load_init(loaded[name], ctx)
 
     def register_child(self, block, name=None):
         """Registers block as a child of self. :py:class:`Block` s assigned to self as


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services