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/06/12 17:16:53 UTC

[incubator-mxnet] branch master updated: fix loading params if ignore_extra is set (#11235)

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 2d761c9  fix loading params if ignore_extra is set (#11235)
2d761c9 is described below

commit 2d761c9ac722b9ba5b98687b906513658bc0add5
Author: Joshua Z. Zhang <ch...@gmail.com>
AuthorDate: Tue Jun 12 10:16:43 2018 -0700

    fix loading params if ignore_extra is set (#11235)
---
 python/mxnet/gluon/block.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/python/mxnet/gluon/block.py b/python/mxnet/gluon/block.py
index f107da3..7406a5d 100644
--- a/python/mxnet/gluon/block.py
+++ b/python/mxnet/gluon/block.py
@@ -355,7 +355,8 @@ class Block(object):
                     "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

-- 
To stop receiving notification emails like this one, please contact
jxie@apache.org.